DMA Engine development
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: jun qian <hangdianqj@163.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vkoul@kernel.org>, Jun Nie <jun.nie@linaro.org>,
	Baoyou Xie <baoyou.xie@linaro.org>,
	Shawn Guo <shawnguo@kernel.org>
Cc: dmaengine@vger.kernel.org, Barry song <21cnbao@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: dmaengine: zx-dma: replace spin_lock_irqsave with spin_lock in ISR
Date: Tue, 11 Sep 2018 17:17:16 +0200	[thread overview]
Message-ID: <1536679036.3362.58.camel@pengutronix.de> (raw)

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);
>  		}
>  	}

             reply	other threads:[~2018-09-11 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 15:17 Lucas Stach [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-11 14:31 dmaengine: zx-dma: replace spin_lock_irqsave with spin_lock in ISR jun qian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536679036.3362.58.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=21cnbao@gmail.com \
    --cc=baoyou.xie@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=hangdianqj@163.com \
    --cc=jun.nie@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox