summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2021-08-26 11:47:42 +0200
committerVinod Koul <vkoul@kernel.org>2021-10-01 17:26:30 +0530
commit9558cf4ad07e8913c14e83959212ae8fdf60cfea (patch)
treed1d24df578fcc5ed370762b64dd3a94dae13b5df
parent193a750df59580ddda6779290fa3898ba3216d3c (diff)
downloadlinux-9558cf4ad07e8913c14e83959212ae8fdf60cfea.tar.gz
dmaengine: zynqmp_dma: fix lockdep warning in tasklet
The tasklet that handles the completed dma transfers uses spin_unlock
for unlocking a spin lock that was previously locked with
spin_lock_irqsave.

This caused the following lockdep warning about an inconsistent lock
state:

	inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.

We must use spin_lock_irqsave, because it is possible to queue DMA
transfers from an irq handler.

Replace the spin_unlock and spin_lock by spin_unlock_irqrestore and
spin_lock_irqsave.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Link: https://lore.kernel.org/r/20210826094742.1302009-8-m.tretter@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/xilinx/zynqmp_dma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index b4220cb88da6..54adac6391ef 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -611,9 +611,9 @@ static void zynqmp_dma_chan_desc_cleanup(struct zynqmp_dma_chan *chan)
 		callback = desc->async_tx.callback;
 		callback_param = desc->async_tx.callback_param;
 		if (callback) {
-			spin_unlock(&chan->lock);
+			spin_unlock_irqrestore(&chan->lock, irqflags);
 			callback(callback_param);
-			spin_lock(&chan->lock);
+			spin_lock_irqsave(&chan->lock, irqflags);
 		}
 
 		/* Run any dependencies, then free the descriptor */