Commit 4ad5dd2d authored by Bumyong Lee's avatar Bumyong Lee Committed by Vinod Koul
Browse files

dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc



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: default avatarJongho Park <jongho7.park@samsung.com>
Signed-off-by: default avatarBumyong Lee <bumyong.lee@samsung.com>
Signed-off-by: default avatarChanho Park <chanho61.park@samsung.com>
Link: https://lore.kernel.org/r/20210507063647.111209-1-chanho61.park@samsung.com


Fixes: f6f2421c ("dmaengine: pl330: Merge dma_pl330_dmac and pl330_dmac structs")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 17866bc6
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -2694,13 +2694,15 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
	for (i = 0; i < len / period_len; i++) {
	for (i = 0; i < len / period_len; i++) {
		desc = pl330_get_desc(pch);
		desc = pl330_get_desc(pch);
		if (!desc) {
		if (!desc) {
			unsigned long iflags;

			dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
			dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
				__func__, __LINE__);
				__func__, __LINE__);


			if (!first)
			if (!first)
				return NULL;
				return NULL;


			spin_lock_irqsave(&pl330->pool_lock, flags);
			spin_lock_irqsave(&pl330->pool_lock, iflags);


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


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


			spin_unlock_irqrestore(&pl330->pool_lock, flags);
			spin_unlock_irqrestore(&pl330->pool_lock, iflags);


			return NULL;
			return NULL;
		}
		}