Skip to contentSkip to conversation

dmaengine: sf-pdma: apply proper spinlock flags in sf_pdma_prep_dma_memcpy()

PATCH Applied Austin Kim 2 participants 3 messages Jun 11, 2021 – Jun 16, 2021

Subsystems (2)
lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 dmaengine: sf-pdma: apply proper spinlock flags in sf_pdma_prep_dma_memcpy()

From: Austin Kim <[email protected]>

The second parameter of spinlock_irq[save/restore] function is flags, which is the last input parameter of sf_pdma_prep_dma_memcpy().

So declare local variable 'iflags' to be used as the second parameter of spinlock_irq[save/restore] function.

---
 drivers/dma/sf-pdma/sf-pdma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/dma/sf-pdma/sf-pdma.c +3 -2
index c4c4e8575764..f12606aeff87 100644
@@ -94,6 +94,7 @@ sf_pdma_prep_dma_memcpy(struct dma_chan *dchan,	dma_addr_t dest, dma_addr_t src,
 {
 	struct sf_pdma_chan *chan = to_sf_pdma_chan(dchan);
 	struct sf_pdma_desc *desc;
+	unsigned long iflags;
 
 	if (chan && (!len || !dest || !src)) {
 		dev_err(chan->pdma->dma_dev.dev,
@@ -109,10 +110,10 @@ sf_pdma_prep_dma_memcpy(struct dma_chan *dchan,	dma_addr_t dest, dma_addr_t src,
 	desc->dirn = DMA_MEM_TO_MEM;
 	desc->async_tx = vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
 
-	spin_lock_irqsave(&chan->vchan.lock, flags);
+	spin_lock_irqsave(&chan->vchan.lock, iflags);
 	chan->desc = desc;
 	sf_pdma_fill_desc(desc, dest, src, len);
-	spin_unlock_irqrestore(&chan->vchan.lock, flags);
+	spin_unlock_irqrestore(&chan->vchan.lock, iflags);
 
 	return desc->async_tx;
 }
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Austin Kim

From: Austin Kim <[email protected]>

The second parameter of spinlock_irq[save/restore] function is flags, which is the last input parameter of sf_pdma_prep_dma_memcpy().

So declare local variable 'iflags' to be used as the second parameter of spinlock_irq[save/restore] function.

Applied, thanks

Signature · 1 line
~Vinod
author
#2 lore raw

2021년 6월 16일 (수) 오후 7:40, Vinod Koul <[email protected]>님이 작성:

Quoted 11 lines · Austin Kim
Quoted 7 lines

From: Austin Kim <[email protected]>

The second parameter of spinlock_irq[save/restore] function is flags, which is the last input parameter of sf_pdma_prep_dma_memcpy().

So declare local variable 'iflags' to be used as the second parameter of spinlock_irq[save/restore] function.

Applied, thanks

Great, thanks!

Quoted 3 lines

--
~Vinod