* [PATCH] dmaengine: zx-dma: replace spin_lock_irqsave with spin_lock in ISR
@ 2018-09-11 14:31 jun qian
2018-09-11 15:17 ` Lucas Stach
0 siblings, 1 reply; 2+ messages in thread
From: jun qian @ 2018-09-11 14:31 UTC (permalink / raw)
To: Dan Williams, Vinod Koul, Jun Nie, Baoyou Xie, Shawn Guo
Cc: linux-arm-kernel, dmaengine, linux-kernel, jun qian, Barry song
As you are already in ISR, it is unnecessary to call spin_lock_irqsave.
Signed-off-by: jun qian <hangdianqj@163.com>
Cc: Barry song <21cnbao@gmail.com>
---
drivers/dma/zx_dma.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 2571bc7693df..111ab2db83b1 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -288,9 +288,8 @@ static irqreturn_t zx_dma_int_handler(int irq, void *dev_id)
p = &d->phy[i];
c = p->vchan;
if (c) {
- unsigned long flags;
- spin_lock_irqsave(&c->vc.lock, flags);
+ spin_lock(&c->vc.lock);
if (c->cyclic) {
vchan_cyclic_callback(&p->ds_run->vd);
} else {
@@ -298,7 +297,7 @@ static irqreturn_t zx_dma_int_handler(int irq, void *dev_id)
p->ds_done = p->ds_run;
task = 1;
}
- spin_unlock_irqrestore(&c->vc.lock, flags);
+ spin_unlock(&c->vc.lock);
irq_chan |= BIT(i);
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: zx-dma: replace spin_lock_irqsave with spin_lock in ISR
2018-09-11 14:31 [PATCH] dmaengine: zx-dma: replace spin_lock_irqsave with spin_lock in ISR jun qian
@ 2018-09-11 15:17 ` Lucas Stach
0 siblings, 0 replies; 2+ messages in thread
From: Lucas Stach @ 2018-09-11 15:17 UTC (permalink / raw)
To: jun qian, Dan Williams, Vinod Koul, Jun Nie, Baoyou Xie, Shawn Guo
Cc: dmaengine, Barry song, linux-kernel, linux-arm-kernel
Am Dienstag, den 11.09.2018, 07:31 -0700 schrieb jun qian:
> As you are already in ISR, it is unnecessary to call
> spin_lock_irqsave.
As the IRQ in this driver isn't marked with IRQF_NO_THREAD, this is
going to blow up if the kernel is booted with the "threadirqs" command
line argument.
Regards,
Lucas
> Signed-off-by: jun qian <hangdianqj@163.com>
> Cc: Barry song <21cnbao@gmail.com>
> ---
> drivers/dma/zx_dma.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
> index 2571bc7693df..111ab2db83b1 100644
> --- a/drivers/dma/zx_dma.c
> +++ b/drivers/dma/zx_dma.c
> @@ -288,9 +288,8 @@ static irqreturn_t zx_dma_int_handler(int irq,
> void *dev_id)
> p = &d->phy[i];
> c = p->vchan;
> if (c) {
> - unsigned long flags;
>
> - spin_lock_irqsave(&c->vc.lock, flags);
> + spin_lock(&c->vc.lock);
> if (c->cyclic) {
> vchan_cyclic_callback(&p->ds_run-
> >vd);
> } else {
> @@ -298,7 +297,7 @@ static irqreturn_t zx_dma_int_handler(int irq,
> void *dev_id)
> p->ds_done = p->ds_run;
> task = 1;
> }
> - spin_unlock_irqrestore(&c->vc.lock, flags);
> + spin_unlock(&c->vc.lock);
> irq_chan |= BIT(i);
> }
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-11 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 14:31 [PATCH] dmaengine: zx-dma: replace spin_lock_irqsave with spin_lock in ISR jun qian
2018-09-11 15:17 ` Lucas Stach
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).