Skip to content

Commit f217130

Browse files
maruthi machanikv2019i
authored andcommitted
dma: dma channel null condition check
dma channel null condition check for pipelines without using any of the specified dma channels. Signed-off-by: maruthi machani <maruthi.machani@amd.corp-partner.google.com>
1 parent 8862f88 commit f217130

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/schedule/dma_multi_chan_domain.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ static int dma_multi_chan_domain_register(struct ll_schedule_domain *domain,
131131
if (!pipe_task->registrable)
132132
goto out;
133133

134-
for (i = 0; i < dma_domain->num_dma; ++i) {
135-
for (j = 0; j < dmas[i].plat_data.channels; ++j) {
134+
for (i = 0; i < dma_domain->num_dma ; ++i) {
135+
if (dmas[i].chan == NULL)
136+
continue;
137+
for (j = 0; j < dmas[i].plat_data.channels ; ++j) {
136138
/* channel not set as scheduling source */
137139
if (!dma_is_scheduling_source(&dmas[i].chan[j]))
138140
continue;
@@ -222,7 +224,9 @@ static int dma_multi_chan_domain_unregister(struct ll_schedule_domain *domain,
222224
return 0;
223225

224226
for (i = 0; i < dma_domain->num_dma; ++i) {
225-
for (j = 0; j < dmas[i].plat_data.channels; ++j) {
227+
if (dmas[i].chan == NULL)
228+
continue;
229+
for (j = 0; j < dmas[i].plat_data.channels ; ++j) {
226230
/* channel not set as scheduling source */
227231
if (!dma_is_scheduling_source(&dmas[i].chan[j]))
228232
continue;
@@ -280,6 +284,8 @@ static bool dma_multi_chan_domain_is_pending(struct ll_schedule_domain *domain,
280284
int j;
281285

282286
for (i = 0; i < dma_domain->num_dma; ++i) {
287+
if (dmas[i].chan == NULL)
288+
continue;
283289
for (j = 0; j < dmas[i].plat_data.channels; ++j) {
284290
if (!*comp) {
285291
status = dma_interrupt_legacy(&dmas[i].chan[j],

0 commit comments

Comments
 (0)