Skip to content

Commit e021ccf

Browse files
RanderWangnashif
authored andcommitted
drivers: dma: intel-adsp-hda: add delay to stop host dma
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]>
1 parent 3848fb8 commit e021ccf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/dma/dma_intel_adsp_hda.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,14 @@ int intel_adsp_hda_dma_stop(const struct device *dev, uint32_t channel)
326326

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

329+
/* host dma needs some cycles to completely stop */
330+
if (cfg->direction == HOST_TO_MEMORY || cfg->direction == MEMORY_TO_HOST) {
331+
if (!WAIT_FOR(!(*DGCS(cfg->base, cfg->regblock_size, channel) & DGCS_GBUSY), 1000,
332+
k_busy_wait(1))) {
333+
return -EBUSY;
334+
}
335+
}
336+
329337
return pm_device_runtime_put(dev);
330338
}
331339

0 commit comments

Comments
 (0)