Skip to content

Commit

Permalink
dmaengine: zynqmp_dma: fix lockdep warning in tasklet
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tretter authored and vinodkoul committed Oct 1, 2021
1 parent 193a750 commit 9558cf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/xilinx/zynqmp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9558cf4

Please sign in to comment.