Skip to content

Commit

Permalink
chain_dma: workaround for failed DMA stop on pause/stop
Browse files Browse the repository at this point in the history
Starting with Zephyr commit e021ccfc745221c6 ("drivers: dma:
intel-adsp-hda: add delay to stop host dma"), the pause-resume
sof-test cases started failing on Intel cAVS2.5 platforms.

Add a delay loop around DMA stop code in chain DMA to workaround
the issue while a proper fix is under investigation. This allows
to resume integration of newer Zephyr versions to SOF and ensure
we detect any new regressions in time.

Link: thesofproject#8792
Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i authored and lyakh committed Jan 30, 2024
1 parent 8bfb489 commit da98742
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/audio/chain_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,28 @@ static int chain_host_stop(struct comp_dev *dev)
int err;

err = dma_stop(cd->chan_host->dma->z_dev, cd->chan_host->index);
if (err < 0)
if (err < 0) {
if (err == -EBUSY) {
int retries = 100;

comp_warn(dev, "dma_stop() fail chan_index = %u, retrying...",
cd->chan_link->index);

/*
* FIXME: ugly workaround for
* https://github.com/thesofproject/sof/issues/8686
*/
while (err == -EBUSY && --retries) {
k_busy_wait(10);
err = dma_stop(cd->chan_link->dma->z_dev, cd->chan_link->index);
if (!err)
goto out;
}
}
return err;
}

out:
comp_info(dev, "chain_host_stop(): dma_stop() host chan_index = %u",
cd->chan_host->index);

Expand Down

0 comments on commit da98742

Please sign in to comment.