Skip to content

Commit df203c1

Browse files
bumyongleegregkh
authored andcommitted
dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc
commit 4ad5dd2 upstream. flags varible which is the input parameter of pl330_prep_dma_cyclic() should not be used by spinlock_irq[save/restore] function. Signed-off-by: Jongho Park <jongho7.park@samsung.com> Signed-off-by: Bumyong Lee <bumyong.lee@samsung.com> Signed-off-by: Chanho Park <chanho61.park@samsung.com> Link: https://lore.kernel.org/r/20210507063647.111209-1-chanho61.park@samsung.com Fixes: f6f2421 ("dmaengine: pl330: Merge dma_pl330_dmac and pl330_dmac structs") Cc: stable@vger.kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b842b56 commit df203c1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/dma/pl330.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,13 +2696,15 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
26962696
for (i = 0; i < len / period_len; i++) {
26972697
desc = pl330_get_desc(pch);
26982698
if (!desc) {
2699+
unsigned long iflags;
2700+
26992701
dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
27002702
__func__, __LINE__);
27012703

27022704
if (!first)
27032705
return NULL;
27042706

2705-
spin_lock_irqsave(&pl330->pool_lock, flags);
2707+
spin_lock_irqsave(&pl330->pool_lock, iflags);
27062708

27072709
while (!list_empty(&first->node)) {
27082710
desc = list_entry(first->node.next,
@@ -2712,7 +2714,7 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
27122714

27132715
list_move_tail(&first->node, &pl330->desc_pool);
27142716

2715-
spin_unlock_irqrestore(&pl330->pool_lock, flags);
2717+
spin_unlock_irqrestore(&pl330->pool_lock, iflags);
27162718

27172719
return NULL;
27182720
}

0 commit comments

Comments
 (0)