linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc
       [not found] <CGME20210507063730epcas2p3c08de48b052cc7d8dc2805a16cd79361@epcas2p3.samsung.com>
@ 2021-05-07  6:36 ` Chanho Park
  2021-05-10 16:09   ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Chanho Park @ 2021-05-07  6:36 UTC (permalink / raw)
  To: Vinod Koul, Philipp Zabel
  Cc: dmaengine, linux-kernel, Bumyong Lee, Jongho Park, Chanho Park

From: Bumyong Lee <bumyong.lee@samsung.com>

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>
---
 drivers/dma/pl330.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index fd8d2bc3be9f..110de8a60058 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2694,13 +2694,15 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
 	for (i = 0; i < len / period_len; i++) {
 		desc = pl330_get_desc(pch);
 		if (!desc) {
+			unsigned long iflags;
+
 			dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
 				__func__, __LINE__);
 
 			if (!first)
 				return NULL;
 
-			spin_lock_irqsave(&pl330->pool_lock, flags);
+			spin_lock_irqsave(&pl330->pool_lock, iflags);
 
 			while (!list_empty(&first->node)) {
 				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);
 
-			spin_unlock_irqrestore(&pl330->pool_lock, flags);
+			spin_unlock_irqrestore(&pl330->pool_lock, iflags);
 
 			return NULL;
 		}
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc
  2021-05-07  6:36 ` [PATCH] dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc Chanho Park
@ 2021-05-10 16:09   ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-05-10 16:09 UTC (permalink / raw)
  To: Chanho Park
  Cc: Philipp Zabel, dmaengine, linux-kernel, Bumyong Lee, Jongho Park

On 07-05-21, 15:36, Chanho Park wrote:
> From: Bumyong Lee <bumyong.lee@samsung.com>
> 
> flags varible which is the input parameter of pl330_prep_dma_cyclic()
> should not be used by spinlock_irq[save/restore] function.

It should mention Fixes. I have added that and cced stable

Thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-10 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210507063730epcas2p3c08de48b052cc7d8dc2805a16cd79361@epcas2p3.samsung.com>
2021-05-07  6:36 ` [PATCH] dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc Chanho Park
2021-05-10 16:09   ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).