Skip to content

Commit a8ac02f

Browse files
ujfalusinashif
authored andcommitted
drivers: dma: intel-adsp-gpdma: Account for LLPL wrapping
In case the LLP wraps we need to re-read the LLPU to make sure we return the correct value. Suggested-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]>
1 parent 2294525 commit a8ac02f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/dma/dma_intel_adsp_gpdma.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,15 @@ static inline void intel_adsp_gpdma_llp_read(const struct device *dev,
131131
{
132132
#ifdef CONFIG_DMA_INTEL_ADSP_GPDMA_HAS_LLP
133133
const struct intel_adsp_gpdma_cfg *const dev_cfg = dev->config;
134+
uint32_t tmp;
134135

135-
*llp_l = dw_read(dev_cfg->shim, GPDMA_CHLLPL(channel));
136+
tmp = dw_read(dev_cfg->shim, GPDMA_CHLLPL(channel));
136137
*llp_u = dw_read(dev_cfg->shim, GPDMA_CHLLPU(channel));
138+
*llp_l = dw_read(dev_cfg->shim, GPDMA_CHLLPL(channel));
139+
if (tmp > *llp_l) {
140+
/* re-read the LLPU value, as LLPL just wrapped */
141+
*llp_u = dw_read(dev_cfg->shim, GPDMA_CHLLPU(channel));
142+
}
137143
#endif
138144
}
139145

0 commit comments

Comments
 (0)