Commit 506875c3 authored by Tudor Ambarus's avatar Tudor Ambarus Committed by Vinod Koul

dmaengine: at_xdmac: Fix concurrency over chan's completed_cookie

Caller of dma_cookie_complete is expected to hold a lock to prevent
concurrency over the channel's completed cookie marker. Call
dma_cookie_complete() with the lock held.

Fixes: e1f7c9ee ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20211215110115.191749-5-tudor.ambarus@microchip.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 5edc24ac
......@@ -1703,11 +1703,10 @@ static void at_xdmac_tasklet(struct tasklet_struct *t)
}
txd = &desc->tx_dma_desc;
dma_cookie_complete(txd);
at_xdmac_remove_xfer(atchan, desc);
spin_unlock_irq(&atchan->lock);
dma_cookie_complete(txd);
if (txd->flags & DMA_PREP_INTERRUPT)
dmaengine_desc_get_callback_invoke(txd, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment