dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore
@ 2020-10-15 23:59 Barry Song
  2020-10-15 23:59 ` [PATCH 01/10] dmaengine: ipu_idmac: remove redundant irqsave and restore in hardIRQ Barry Song
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: baohua

From: baohua <x@1.com>

In hardIRQ context, it is redundant to disable and restore irq status.

Barry Song (10):
  dmaengine: ipu_idmac: remove redundant irqsave and restore in hardIRQ
  dmaengine: k3-udma: remove redundant irqsave and irqrestore in hardIRQ
  dmaengine: sf-pdma: remove redundant irqsave and irqrestore in hardIRQ
  dmaengine: tegra210-adma: remove redundant irqsave and irqrestore in
    hardIRQ
  dmaengine: milbeaut-xdmac: remove redundant irqsave and irqrestore in
    hardIRQ
  dmaengine: k3dma: remove redundant irqsave and irqrestore in hardIRQ
  dmaengine: hisi_dma: remove redundant irqsave and irqrestore in
    hardIRQ
  dmaengine: moxart-dma: remove redundant irqsave and irqrestore in
    hardIRQ
  dmaengine: ste_dma40: remove redundant irqsave and irqrestore in
    hardIRQ
  dmaengine: pxa_dma: remove redundant irqsave and irqrestore in hardIRQ

 drivers/dma/hisi_dma.c        |  5 ++---
 drivers/dma/ipu/ipu_idmac.c   | 11 +++++------
 drivers/dma/k3dma.c           |  9 ++++-----
 drivers/dma/milbeaut-xdmac.c  |  5 ++---
 drivers/dma/moxart-dma.c      |  5 ++---
 drivers/dma/pxa_dma.c         |  5 ++---
 drivers/dma/sf-pdma/sf-pdma.c | 10 ++++------
 drivers/dma/ste_dma40.c       |  5 ++---
 drivers/dma/tegra210-adma.c   |  7 +++----
 drivers/dma/ti/k3-udma.c      | 10 ++++------
 10 files changed, 30 insertions(+), 42 deletions(-)

-- 
2.25.1


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

* [PATCH 01/10] dmaengine: ipu_idmac: remove redundant irqsave and restore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-15 23:59 ` [PATCH 02/10] dmaengine: k3-udma: remove redundant irqsave and irqrestore " Barry Song
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song

Running in hardIRQ, disabling IRQ is redundant.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/ipu/ipu_idmac.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index 38036db284cb..104ad420abbe 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -1160,14 +1160,13 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id)
 	struct idmac_tx_desc *desc, *descnew;
 	bool done = false;
 	u32 ready0, ready1, curbuf, err;
-	unsigned long flags;
 	struct dmaengine_desc_callback cb;
 
 	/* IDMAC has cleared the respective BUFx_RDY bit, we manage the buffer */
 
 	dev_dbg(dev, "IDMAC irq %d, buf %d\n", irq, ichan->active_buffer);
 
-	spin_lock_irqsave(&ipu_data.lock, flags);
+	spin_lock(&ipu_data.lock);
 
 	ready0	= idmac_read_ipureg(&ipu_data, IPU_CHA_BUF0_RDY);
 	ready1	= idmac_read_ipureg(&ipu_data, IPU_CHA_BUF1_RDY);
@@ -1176,7 +1175,7 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id)
 
 	if (err & (1 << chan_id)) {
 		idmac_write_ipureg(&ipu_data, 1 << chan_id, IPU_INT_STAT_4);
-		spin_unlock_irqrestore(&ipu_data.lock, flags);
+		spin_unlock(&ipu_data.lock);
 		/*
 		 * Doing this
 		 * ichan->sg[0] = ichan->sg[1] = NULL;
@@ -1188,7 +1187,7 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id)
 			 chan_id, ready0, ready1, curbuf);
 		return IRQ_HANDLED;
 	}
-	spin_unlock_irqrestore(&ipu_data.lock, flags);
+	spin_unlock(&ipu_data.lock);
 
 	/* Other interrupts do not interfere with this channel */
 	spin_lock(&ichan->lock);
@@ -1251,9 +1250,9 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id)
 		if (unlikely(sgnew)) {
 			ipu_submit_buffer(ichan, descnew, sgnew, !ichan->active_buffer);
 		} else {
-			spin_lock_irqsave(&ipu_data.lock, flags);
+			spin_lock(&ipu_data.lock);
 			ipu_ic_disable_task(&ipu_data, chan_id);
-			spin_unlock_irqrestore(&ipu_data.lock, flags);
+			spin_unlock(&ipu_data.lock);
 			ichan->status = IPU_CHANNEL_READY;
 			/* Continue to check for complete descriptor */
 		}
-- 
2.25.1


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

* [PATCH 02/10] dmaengine: k3-udma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
  2020-10-15 23:59 ` [PATCH 01/10] dmaengine: ipu_idmac: remove redundant irqsave and restore in hardIRQ Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-19 13:45   ` Peter Ujfalusi
  2020-10-15 23:59 ` [PATCH 03/10] dmaengine: sf-pdma: " Barry Song
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song, Peter Ujfalusi

Running in hardIRQ, disabling IRQ is redundant.

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/ti/k3-udma.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 82cf6c77f5c9..e508280b3d70 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -1020,13 +1020,12 @@ static irqreturn_t udma_ring_irq_handler(int irq, void *data)
 {
 	struct udma_chan *uc = data;
 	struct udma_desc *d;
-	unsigned long flags;
 	dma_addr_t paddr = 0;
 
 	if (udma_pop_from_ring(uc, &paddr) || !paddr)
 		return IRQ_HANDLED;
 
-	spin_lock_irqsave(&uc->vc.lock, flags);
+	spin_lock(&uc->vc.lock);
 
 	/* Teardown completion message */
 	if (cppi5_desc_is_tdcm(paddr)) {
@@ -1077,7 +1076,7 @@ static irqreturn_t udma_ring_irq_handler(int irq, void *data)
 		}
 	}
 out:
-	spin_unlock_irqrestore(&uc->vc.lock, flags);
+	spin_unlock(&uc->vc.lock);
 
 	return IRQ_HANDLED;
 }
@@ -1086,9 +1085,8 @@ static irqreturn_t udma_udma_irq_handler(int irq, void *data)
 {
 	struct udma_chan *uc = data;
 	struct udma_desc *d;
-	unsigned long flags;
 
-	spin_lock_irqsave(&uc->vc.lock, flags);
+	spin_lock(&uc->vc.lock);
 	d = uc->desc;
 	if (d) {
 		d->tr_idx = (d->tr_idx + 1) % d->sglen;
@@ -1103,7 +1101,7 @@ static irqreturn_t udma_udma_irq_handler(int irq, void *data)
 		}
 	}
 
-	spin_unlock_irqrestore(&uc->vc.lock, flags);
+	spin_unlock(&uc->vc.lock);
 
 	return IRQ_HANDLED;
 }
-- 
2.25.1


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

* [PATCH 03/10] dmaengine: sf-pdma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
  2020-10-15 23:59 ` [PATCH 01/10] dmaengine: ipu_idmac: remove redundant irqsave and restore in hardIRQ Barry Song
  2020-10-15 23:59 ` [PATCH 02/10] dmaengine: k3-udma: remove redundant irqsave and irqrestore " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-15 23:59 ` [PATCH 04/10] dmaengine: tegra210-adma: " Barry Song
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song, Green Wan

Running in hardIRQ, disabling IRQ is redundant.

Cc: Green Wan <green.wan@sifive.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/sf-pdma/sf-pdma.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c
index 528deb5d9f31..981ddcc42d70 100644
--- a/drivers/dma/sf-pdma/sf-pdma.c
+++ b/drivers/dma/sf-pdma/sf-pdma.c
@@ -326,10 +326,9 @@ static irqreturn_t sf_pdma_done_isr(int irq, void *dev_id)
 {
 	struct sf_pdma_chan *chan = dev_id;
 	struct pdma_regs *regs = &chan->regs;
-	unsigned long flags;
 	u64 residue;
 
-	spin_lock_irqsave(&chan->vchan.lock, flags);
+	spin_lock(&chan->vchan.lock);
 	writel((readl(regs->ctrl)) & ~PDMA_DONE_STATUS_MASK, regs->ctrl);
 	residue = readq(regs->residue);
 
@@ -346,7 +345,7 @@ static irqreturn_t sf_pdma_done_isr(int irq, void *dev_id)
 		sf_pdma_xfer_desc(chan);
 	}
 
-	spin_unlock_irqrestore(&chan->vchan.lock, flags);
+	spin_unlock(&chan->vchan.lock);
 
 	return IRQ_HANDLED;
 }
@@ -355,11 +354,10 @@ static irqreturn_t sf_pdma_err_isr(int irq, void *dev_id)
 {
 	struct sf_pdma_chan *chan = dev_id;
 	struct pdma_regs *regs = &chan->regs;
-	unsigned long flags;
 
-	spin_lock_irqsave(&chan->lock, flags);
+	spin_lock(&chan->lock);
 	writel((readl(regs->ctrl)) & ~PDMA_ERR_STATUS_MASK, regs->ctrl);
-	spin_unlock_irqrestore(&chan->lock, flags);
+	spin_unlock(&chan->lock);
 
 	tasklet_schedule(&chan->err_tasklet);
 
-- 
2.25.1


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

* [PATCH 04/10] dmaengine: tegra210-adma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (2 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 03/10] dmaengine: sf-pdma: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-19 10:31   ` Jon Hunter
  2020-10-15 23:59 ` [PATCH 05/10] dmaengine: milbeaut-xdmac: " Barry Song
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song, Laxman Dewangan, Jon Hunter, Thierry Reding

Running in hardIRQ, disabling IRQ is redundant.

Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/tegra210-adma.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index c5fa2ef74abc..4735742e826d 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -408,19 +408,18 @@ static irqreturn_t tegra_adma_isr(int irq, void *dev_id)
 {
 	struct tegra_adma_chan *tdc = dev_id;
 	unsigned long status;
-	unsigned long flags;
 
-	spin_lock_irqsave(&tdc->vc.lock, flags);
+	spin_lock(&tdc->vc.lock);
 
 	status = tegra_adma_irq_clear(tdc);
 	if (status == 0 || !tdc->desc) {
-		spin_unlock_irqrestore(&tdc->vc.lock, flags);
+		spin_unlock(&tdc->vc.lock);
 		return IRQ_NONE;
 	}
 
 	vchan_cyclic_callback(&tdc->desc->vd);
 
-	spin_unlock_irqrestore(&tdc->vc.lock, flags);
+	spin_unlock(&tdc->vc.lock);
 
 	return IRQ_HANDLED;
 }
-- 
2.25.1


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

* [PATCH 05/10] dmaengine: milbeaut-xdmac: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (3 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 04/10] dmaengine: tegra210-adma: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-15 23:59 ` [PATCH 06/10] dmaengine: k3dma: " Barry Song
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song

Running in hardIRQ, disabling IRQ is redundant.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/milbeaut-xdmac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/milbeaut-xdmac.c b/drivers/dma/milbeaut-xdmac.c
index 85a597228fb0..584c931e807a 100644
--- a/drivers/dma/milbeaut-xdmac.c
+++ b/drivers/dma/milbeaut-xdmac.c
@@ -160,10 +160,9 @@ static irqreturn_t milbeaut_xdmac_interrupt(int irq, void *dev_id)
 {
 	struct milbeaut_xdmac_chan *mc = dev_id;
 	struct milbeaut_xdmac_desc *md;
-	unsigned long flags;
 	u32 val;
 
-	spin_lock_irqsave(&mc->vc.lock, flags);
+	spin_lock(&mc->vc.lock);
 
 	/* Ack and Stop */
 	val = FIELD_PREP(M10V_XDDSD_IS_MASK, 0x0);
@@ -177,7 +176,7 @@ static irqreturn_t milbeaut_xdmac_interrupt(int irq, void *dev_id)
 
 	milbeaut_xdmac_start(mc);
 out:
-	spin_unlock_irqrestore(&mc->vc.lock, flags);
+	spin_unlock(&mc->vc.lock);
 	return IRQ_HANDLED;
 }
 
-- 
2.25.1


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

* [PATCH 06/10] dmaengine: k3dma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (4 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 05/10] dmaengine: milbeaut-xdmac: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-15 23:59 ` [PATCH 07/10] dmaengine: hisi_dma: " Barry Song
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song

Running in hardIRQ, disabling IRQ is redundant.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/k3dma.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index f609a84c493c..d0b2e601e3e5 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -223,24 +223,23 @@ static irqreturn_t k3_dma_int_handler(int irq, void *dev_id)
 		i = __ffs(stat);
 		stat &= ~BIT(i);
 		if (likely(tc1 & BIT(i)) || (tc2 & BIT(i))) {
-			unsigned long flags;
 
 			p = &d->phy[i];
 			c = p->vchan;
 			if (c && (tc1 & BIT(i))) {
-				spin_lock_irqsave(&c->vc.lock, flags);
+				spin_lock(&c->vc.lock);
 				if (p->ds_run != NULL) {
 					vchan_cookie_complete(&p->ds_run->vd);
 					p->ds_done = p->ds_run;
 					p->ds_run = NULL;
 				}
-				spin_unlock_irqrestore(&c->vc.lock, flags);
+				spin_unlock(&c->vc.lock);
 			}
 			if (c && (tc2 & BIT(i))) {
-				spin_lock_irqsave(&c->vc.lock, flags);
+				spin_lock(&c->vc.lock);
 				if (p->ds_run != NULL)
 					vchan_cyclic_callback(&p->ds_run->vd);
-				spin_unlock_irqrestore(&c->vc.lock, flags);
+				spin_unlock(&c->vc.lock);
 			}
 			irq_chan |= BIT(i);
 		}
-- 
2.25.1


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

* [PATCH 07/10] dmaengine: hisi_dma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (5 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 06/10] dmaengine: k3dma: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-26  1:23   ` Zhou Wang
  2020-10-15 23:59 ` [PATCH 08/10] dmaengine: moxart-dma: " Barry Song
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song, Zhou Wang

Running in hardIRQ, disabling IRQ is redundant.

Cc: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/hisi_dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
index e1a958ae7925..a259ee010e9b 100644
--- a/drivers/dma/hisi_dma.c
+++ b/drivers/dma/hisi_dma.c
@@ -431,9 +431,8 @@ static irqreturn_t hisi_dma_irq(int irq, void *data)
 	struct hisi_dma_dev *hdma_dev = chan->hdma_dev;
 	struct hisi_dma_desc *desc;
 	struct hisi_dma_cqe *cqe;
-	unsigned long flags;
 
-	spin_lock_irqsave(&chan->vc.lock, flags);
+	spin_lock(&chan->vc.lock);
 
 	desc = chan->desc;
 	cqe = chan->cq + chan->cq_head;
@@ -452,7 +451,7 @@ static irqreturn_t hisi_dma_irq(int irq, void *data)
 		chan->desc = NULL;
 	}
 
-	spin_unlock_irqrestore(&chan->vc.lock, flags);
+	spin_unlock(&chan->vc.lock);
 
 	return IRQ_HANDLED;
 }
-- 
2.25.1


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

* [PATCH 08/10] dmaengine: moxart-dma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (6 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 07/10] dmaengine: hisi_dma: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-15 23:59 ` [PATCH 09/10] dmaengine: ste_dma40: " Barry Song
  2020-10-15 23:59 ` [PATCH 10/10] dmaengine: pxa_dma: " Barry Song
  9 siblings, 0 replies; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song

Running in hardIRQ, disabling IRQ is redundant.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/moxart-dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
index 347146a6e1d0..74755093e14b 100644
--- a/drivers/dma/moxart-dma.c
+++ b/drivers/dma/moxart-dma.c
@@ -524,7 +524,6 @@ static irqreturn_t moxart_dma_interrupt(int irq, void *devid)
 	struct moxart_dmadev *mc = devid;
 	struct moxart_chan *ch = &mc->slave_chans[0];
 	unsigned int i;
-	unsigned long flags;
 	u32 ctrl;
 
 	dev_dbg(chan2dev(&ch->vc.chan), "%s\n", __func__);
@@ -541,14 +540,14 @@ static irqreturn_t moxart_dma_interrupt(int irq, void *devid)
 		if (ctrl & APB_DMA_FIN_INT_STS) {
 			ctrl &= ~APB_DMA_FIN_INT_STS;
 			if (ch->desc) {
-				spin_lock_irqsave(&ch->vc.lock, flags);
+				spin_lock(&ch->vc.lock);
 				if (++ch->sgidx < ch->desc->sglen) {
 					moxart_dma_start_sg(ch, ch->sgidx);
 				} else {
 					vchan_cookie_complete(&ch->desc->vd);
 					moxart_dma_start_desc(&ch->vc.chan);
 				}
-				spin_unlock_irqrestore(&ch->vc.lock, flags);
+				spin_unlock(&ch->vc.lock);
 			}
 		}
 
-- 
2.25.1


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

* [PATCH 09/10] dmaengine: ste_dma40: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (7 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 08/10] dmaengine: moxart-dma: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-29 14:01   ` Linus Walleij
  2020-10-15 23:59 ` [PATCH 10/10] dmaengine: pxa_dma: " Barry Song
  9 siblings, 1 reply; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song, Linus Walleij

Running in hardIRQ, disabling IRQ is redundant.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/ste_dma40.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 77ab1f4730be..4256e55bbf25 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1643,13 +1643,12 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
 	u32 row;
 	long chan = -1;
 	struct d40_chan *d40c;
-	unsigned long flags;
 	struct d40_base *base = data;
 	u32 *regs = base->regs_interrupt;
 	struct d40_interrupt_lookup *il = base->gen_dmac.il;
 	u32 il_size = base->gen_dmac.il_size;
 
-	spin_lock_irqsave(&base->interrupt_lock, flags);
+	spin_lock(&base->interrupt_lock);
 
 	/* Read interrupt status of both logical and physical channels */
 	for (i = 0; i < il_size; i++)
@@ -1694,7 +1693,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
 		spin_unlock(&d40c->lock);
 	}
 
-	spin_unlock_irqrestore(&base->interrupt_lock, flags);
+	spin_unlock(&base->interrupt_lock);
 
 	return IRQ_HANDLED;
 }
-- 
2.25.1


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

* [PATCH 10/10] dmaengine: pxa_dma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
                   ` (8 preceding siblings ...)
  2020-10-15 23:59 ` [PATCH 09/10] dmaengine: ste_dma40: " Barry Song
@ 2020-10-15 23:59 ` Barry Song
  2020-10-23 20:16   ` Robert Jarzmik
  9 siblings, 1 reply; 17+ messages in thread
From: Barry Song @ 2020-10-15 23:59 UTC (permalink / raw)
  To: vkoul, dmaengine; +Cc: Barry Song, Daniel Mack, Haojian Zhuang, Robert Jarzmik

Running in hardIRQ, disabling IRQ is redundant.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/dma/pxa_dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index 349fb312c872..4a2a796e348c 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -606,7 +606,6 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id)
 	struct pxad_chan *chan = phy->vchan;
 	struct virt_dma_desc *vd, *tmp;
 	unsigned int dcsr;
-	unsigned long flags;
 	bool vd_completed;
 	dma_cookie_t last_started = 0;
 
@@ -616,7 +615,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id)
 	if (dcsr & PXA_DCSR_RUN)
 		return IRQ_NONE;
 
-	spin_lock_irqsave(&chan->vc.lock, flags);
+	spin_lock(&chan->vc.lock);
 	list_for_each_entry_safe(vd, tmp, &chan->vc.desc_issued, node) {
 		vd_completed = is_desc_completed(vd);
 		dev_dbg(&chan->vc.chan.dev->device,
@@ -658,7 +657,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id)
 			pxad_launch_chan(chan, to_pxad_sw_desc(vd));
 		}
 	}
-	spin_unlock_irqrestore(&chan->vc.lock, flags);
+	spin_unlock(&chan->vc.lock);
 	wake_up(&chan->wq_state);
 
 	return IRQ_HANDLED;
-- 
2.25.1


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

* Re: [PATCH 04/10] dmaengine: tegra210-adma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 ` [PATCH 04/10] dmaengine: tegra210-adma: " Barry Song
@ 2020-10-19 10:31   ` Jon Hunter
  0 siblings, 0 replies; 17+ messages in thread
From: Jon Hunter @ 2020-10-19 10:31 UTC (permalink / raw)
  To: Barry Song, vkoul, dmaengine; +Cc: Laxman Dewangan, Thierry Reding


On 16/10/2020 00:59, Barry Song wrote:
> Running in hardIRQ, disabling IRQ is redundant.
> 
> Cc: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: Jon Hunter <jonathanh@nvidia.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
> ---
>  drivers/dma/tegra210-adma.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> index c5fa2ef74abc..4735742e826d 100644
> --- a/drivers/dma/tegra210-adma.c
> +++ b/drivers/dma/tegra210-adma.c
> @@ -408,19 +408,18 @@ static irqreturn_t tegra_adma_isr(int irq, void *dev_id)
>  {
>  	struct tegra_adma_chan *tdc = dev_id;
>  	unsigned long status;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&tdc->vc.lock, flags);
> +	spin_lock(&tdc->vc.lock);
>  
>  	status = tegra_adma_irq_clear(tdc);
>  	if (status == 0 || !tdc->desc) {
> -		spin_unlock_irqrestore(&tdc->vc.lock, flags);
> +		spin_unlock(&tdc->vc.lock);
>  		return IRQ_NONE;
>  	}
>  
>  	vchan_cyclic_callback(&tdc->desc->vd);
>  
> -	spin_unlock_irqrestore(&tdc->vc.lock, flags);
> +	spin_unlock(&tdc->vc.lock);
>  
>  	return IRQ_HANDLED;
>  }
> 


Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon

-- 
nvpublic

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

* Re: [PATCH 02/10] dmaengine: k3-udma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 ` [PATCH 02/10] dmaengine: k3-udma: remove redundant irqsave and irqrestore " Barry Song
@ 2020-10-19 13:45   ` Peter Ujfalusi
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Ujfalusi @ 2020-10-19 13:45 UTC (permalink / raw)
  To: Barry Song, vkoul, dmaengine



On 16/10/2020 2.59, Barry Song wrote:
> Running in hardIRQ, disabling IRQ is redundant.

Subject should be: dmaengine: ti: k3-udma: ...

Other than that:
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
> ---
>  drivers/dma/ti/k3-udma.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 82cf6c77f5c9..e508280b3d70 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -1020,13 +1020,12 @@ static irqreturn_t udma_ring_irq_handler(int irq, void *data)
>  {
>  	struct udma_chan *uc = data;
>  	struct udma_desc *d;
> -	unsigned long flags;
>  	dma_addr_t paddr = 0;
>  
>  	if (udma_pop_from_ring(uc, &paddr) || !paddr)
>  		return IRQ_HANDLED;
>  
> -	spin_lock_irqsave(&uc->vc.lock, flags);
> +	spin_lock(&uc->vc.lock);
>  
>  	/* Teardown completion message */
>  	if (cppi5_desc_is_tdcm(paddr)) {
> @@ -1077,7 +1076,7 @@ static irqreturn_t udma_ring_irq_handler(int irq, void *data)
>  		}
>  	}
>  out:
> -	spin_unlock_irqrestore(&uc->vc.lock, flags);
> +	spin_unlock(&uc->vc.lock);
>  
>  	return IRQ_HANDLED;
>  }
> @@ -1086,9 +1085,8 @@ static irqreturn_t udma_udma_irq_handler(int irq, void *data)
>  {
>  	struct udma_chan *uc = data;
>  	struct udma_desc *d;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&uc->vc.lock, flags);
> +	spin_lock(&uc->vc.lock);
>  	d = uc->desc;
>  	if (d) {
>  		d->tr_idx = (d->tr_idx + 1) % d->sglen;
> @@ -1103,7 +1101,7 @@ static irqreturn_t udma_udma_irq_handler(int irq, void *data)
>  		}
>  	}
>  
> -	spin_unlock_irqrestore(&uc->vc.lock, flags);
> +	spin_unlock(&uc->vc.lock);
>  
>  	return IRQ_HANDLED;
>  }
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH 10/10] dmaengine: pxa_dma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 ` [PATCH 10/10] dmaengine: pxa_dma: " Barry Song
@ 2020-10-23 20:16   ` Robert Jarzmik
  0 siblings, 0 replies; 17+ messages in thread
From: Robert Jarzmik @ 2020-10-23 20:16 UTC (permalink / raw)
  To: Barry Song; +Cc: vkoul, dmaengine, Daniel Mack, Haojian Zhuang

Barry Song <song.bao.hua@hisilicon.com> writes:

> Running in hardIRQ, disabling IRQ is redundant.
>
> Cc: Daniel Mack <daniel@zonque.org>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Why not.
I would have liked a longer commit message to explain the reason of the patch,
which probably is a performance optimization (ie. not disabling twice IRQs).

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

--
Robert

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

* Re: [PATCH 07/10] dmaengine: hisi_dma: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 ` [PATCH 07/10] dmaengine: hisi_dma: " Barry Song
@ 2020-10-26  1:23   ` Zhou Wang
  0 siblings, 0 replies; 17+ messages in thread
From: Zhou Wang @ 2020-10-26  1:23 UTC (permalink / raw)
  To: Barry Song, vkoul, dmaengine

On 2020/10/16 7:59, Barry Song wrote:
> Running in hardIRQ, disabling IRQ is redundant.
> 
> Cc: Zhou Wang <wangzhou1@hisilicon.com>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>

Thanks for fixing this :)

Acked-by: Zhou Wang <wangzhou1@hisilicon.com>

> ---
>  drivers/dma/hisi_dma.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
> index e1a958ae7925..a259ee010e9b 100644
> --- a/drivers/dma/hisi_dma.c
> +++ b/drivers/dma/hisi_dma.c
> @@ -431,9 +431,8 @@ static irqreturn_t hisi_dma_irq(int irq, void *data)
>  	struct hisi_dma_dev *hdma_dev = chan->hdma_dev;
>  	struct hisi_dma_desc *desc;
>  	struct hisi_dma_cqe *cqe;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&chan->vc.lock, flags);
> +	spin_lock(&chan->vc.lock);
>  
>  	desc = chan->desc;
>  	cqe = chan->cq + chan->cq_head;
> @@ -452,7 +451,7 @@ static irqreturn_t hisi_dma_irq(int irq, void *data)
>  		chan->desc = NULL;
>  	}
>  
> -	spin_unlock_irqrestore(&chan->vc.lock, flags);
> +	spin_unlock(&chan->vc.lock);
>  
>  	return IRQ_HANDLED;
>  }
> 

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

* Re: [PATCH 09/10] dmaengine: ste_dma40: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-15 23:59 ` [PATCH 09/10] dmaengine: ste_dma40: " Barry Song
@ 2020-10-29 14:01   ` Linus Walleij
  2020-10-29 20:58     ` Song Bao Hua (Barry Song)
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Walleij @ 2020-10-29 14:01 UTC (permalink / raw)
  To: Barry Song; +Cc: Vinod Koul, dmaengine

On Fri, Oct 16, 2020 at 2:03 AM Barry Song <song.bao.hua@hisilicon.com> wrote:

> Running in hardIRQ, disabling IRQ is redundant.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>

That's right!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* RE: [PATCH 09/10] dmaengine: ste_dma40: remove redundant irqsave and irqrestore in hardIRQ
  2020-10-29 14:01   ` Linus Walleij
@ 2020-10-29 20:58     ` Song Bao Hua (Barry Song)
  0 siblings, 0 replies; 17+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-10-29 20:58 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Vinod Koul, dmaengine



> -----Original Message-----
> From: Linus Walleij [mailto:linus.walleij@linaro.org]
> Sent: Friday, October 30, 2020 3:01 AM
> To: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>
> Cc: Vinod Koul <vkoul@kernel.org>; dmaengine <dmaengine@vger.kernel.org>
> Subject: Re: [PATCH 09/10] dmaengine: ste_dma40: remove redundant irqsave
> and irqrestore in hardIRQ
> 
> On Fri, Oct 16, 2020 at 2:03 AM Barry Song <song.bao.hua@hisilicon.com>
> wrote:
> 
> > Running in hardIRQ, disabling IRQ is redundant.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
> 
> That's right!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks, Linus.
I guess you missed v2 in which you actually should have acked :-)

https://lore.kernel.org/dmaengine/20201027215252.25820-10-song.bao.hua@hisilicon.com/

Thanks
Barry

> 
> Yours,
> Linus Walleij

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

end of thread, back to index

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 23:59 [PATCH 00/10] dmaengine: a bundle of cleanup on spin_lock_irqsave/irqrestore Barry Song
2020-10-15 23:59 ` [PATCH 01/10] dmaengine: ipu_idmac: remove redundant irqsave and restore in hardIRQ Barry Song
2020-10-15 23:59 ` [PATCH 02/10] dmaengine: k3-udma: remove redundant irqsave and irqrestore " Barry Song
2020-10-19 13:45   ` Peter Ujfalusi
2020-10-15 23:59 ` [PATCH 03/10] dmaengine: sf-pdma: " Barry Song
2020-10-15 23:59 ` [PATCH 04/10] dmaengine: tegra210-adma: " Barry Song
2020-10-19 10:31   ` Jon Hunter
2020-10-15 23:59 ` [PATCH 05/10] dmaengine: milbeaut-xdmac: " Barry Song
2020-10-15 23:59 ` [PATCH 06/10] dmaengine: k3dma: " Barry Song
2020-10-15 23:59 ` [PATCH 07/10] dmaengine: hisi_dma: " Barry Song
2020-10-26  1:23   ` Zhou Wang
2020-10-15 23:59 ` [PATCH 08/10] dmaengine: moxart-dma: " Barry Song
2020-10-15 23:59 ` [PATCH 09/10] dmaengine: ste_dma40: " Barry Song
2020-10-29 14:01   ` Linus Walleij
2020-10-29 20:58     ` Song Bao Hua (Barry Song)
2020-10-15 23:59 ` [PATCH 10/10] dmaengine: pxa_dma: " Barry Song
2020-10-23 20:16   ` Robert Jarzmik

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git