Skip to content

Commit

Permalink
drivers: dma: intel-adsp-hda: add delay to stop host dma
Browse files Browse the repository at this point in the history
According to hardware spec, host dma needs some delay to completely stop.
In the bug the host dma is disabled in different path in a few microseonds.
The first setting disabled the host dma and called pm_device_runtime_put
to power off it. The second setting found the host dma was still alive
and calle pm_device_runtime_put again. This results to pm->usage
checking failed.

BugLink: thesofproject/sof#8686
Signed-off-by: Rander Wang <[email protected]>
  • Loading branch information
RanderWang authored and abonislawski committed Jan 24, 2024
1 parent 74f331a commit 9140d6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/dma/dma_intel_adsp_hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@ int intel_adsp_hda_dma_stop(const struct device *dev, uint32_t channel)

intel_adsp_hda_disable(cfg->base, cfg->regblock_size, channel);

/* host dma needs some cycles to completely stop */
if (cfg->direction == HOST_TO_MEMORY || cfg->direction == MEMORY_TO_HOST) {
if (!WAIT_FOR(!(*DGCS(cfg->base, cfg->regblock_size, channel) & DGCS_GBUSY), 1000,
k_busy_wait(1))) {
return -EBUSY;
}
}

return pm_device_runtime_put(dev);
}

Expand Down

0 comments on commit 9140d6e

Please sign in to comment.