diff mbox series

[5/7] dmaengine: zynqmp_dma: cleanup after completing all descriptors

Message ID 20210826094742.1302009-6-m.tretter@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series dmaengine: zynqmp_dma: fix lockdep warning and cleanup | expand

Commit Message

Michael Tretter Aug. 26, 2021, 9:47 a.m. UTC
The current implementation iterates the entire done list for each
completed dma descriptor even if there are multiple completed
descriptors.

Avoid this by first moving all completed descriptors to the done list
and afterwards iterating the done list and finishing the descriptors.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/dma/xilinx/zynqmp_dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 61bb1d7f6ec0..f98ef5fe4902 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -759,10 +759,11 @@  static void zynqmp_dma_do_tasklet(struct tasklet_struct *t)
 
 	while (count) {
 		zynqmp_dma_complete_descriptor(chan);
-		zynqmp_dma_chan_desc_cleanup(chan);
 		count--;
 	}
 
+	zynqmp_dma_chan_desc_cleanup(chan);
+
 	if (chan->idle)
 		zynqmp_dma_start_transfer(chan);