Skip to content

Commit cd3851e

Browse files
Olivier Dautricourtgregkh
authored andcommitted
dmaengine: altera-msgdma: use irq variant of spin_lock/unlock while invoking callbacks
[ Upstream commit 261d3a8 ] As we first take the lock with spin_lock_irqsave in msgdma_tasklet, Lockdep might complain about this. Inspired by commit 9558cf4 ("dmaengine: zynqmp_dma: fix lockdep warning in tasklet") Signed-off-by: Olivier Dautricourt <[email protected]> Tested-by: Olivier Dautricourt <[email protected]> Suggested-by: Eric Schwarz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9d56712 commit cd3851e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/dma/altera-msgdma.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ static void msgdma_issue_pending(struct dma_chan *chan)
583583
static void msgdma_chan_desc_cleanup(struct msgdma_device *mdev)
584584
{
585585
struct msgdma_sw_desc *desc, *next;
586+
unsigned long irqflags;
586587

587588
list_for_each_entry_safe(desc, next, &mdev->done_list, node) {
588589
struct dmaengine_desc_callback cb;
@@ -591,9 +592,9 @@ static void msgdma_chan_desc_cleanup(struct msgdma_device *mdev)
591592

592593
dmaengine_desc_get_callback(&desc->async_tx, &cb);
593594
if (dmaengine_desc_callback_valid(&cb)) {
594-
spin_unlock(&mdev->lock);
595+
spin_unlock_irqrestore(&mdev->lock, irqflags);
595596
dmaengine_desc_callback_invoke(&cb, NULL);
596-
spin_lock(&mdev->lock);
597+
spin_lock_irqsave(&mdev->lock, irqflags);
597598
}
598599

599600
/* Run any dependencies, then free the descriptor */

0 commit comments

Comments
 (0)