drivers: imx: sdma: Invalidate cache when reading info from BDs

This invalidation is required in order for the driver to correctly
report the available/free bytes on a given DMA channel.

Fixes: 87d79c48dd ("drivers: imx: sdma: Add SDMA support to SOF")

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This commit is contained in:
Paul Olaru 2023-05-19 15:07:10 +03:00 committed by Daniel Baluta
parent e5455775b0
commit 3fa7ff8098
1 changed files with 2 additions and 0 deletions

View File

@ -888,6 +888,8 @@ static int sdma_get_data_size(struct dma_chan_data *channel, uint32_t *avail,
return -EINVAL;
}
dcache_invalidate_region(pdata->desc, sizeof(pdata->desc[0]) * SDMA_MAX_BDS);
for (i = 0; i < pdata->desc_count && i < SDMA_MAX_BDS; i++) {
if (pdata->desc[i].config & SDMA_BD_DONE)
continue; /* These belong to SDMA controller */