lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 11 Sep 2018 17:17:16 +0200
From:   Lucas Stach <l.stach@...gutronix.de>
To:     jun qian <hangdianqj@....com>,
        Dan Williams <dan.j.williams@...el.com>,
        Vinod Koul <vkoul@...nel.org>, Jun Nie <jun.nie@...aro.org>,
        Baoyou Xie <baoyou.xie@...aro.org>,
        Shawn Guo <shawnguo@...nel.org>
Cc:     dmaengine@...r.kernel.org, Barry song <21cnbao@...il.com>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] dmaengine: zx-dma: replace spin_lock_irqsave with
 spin_lock in ISR

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@....com>
> Cc: Barry song <21cnbao@...il.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);
>  		}
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ