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] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmsIqDPjvZKbbKov@electric-eye.fr.zoreil.com>
Date:   Thu, 28 Apr 2022 23:35:36 +0200
From:   Francois Romieu <romieu@...zoreil.com>
To:     Wells Lu 呂芳騰 <wells.lu@...plus.com>
Cc:     Wells Lu <wellslutw@...il.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
        "roopa@...dia.com" <roopa@...dia.com>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "edumazet@...gle.com" <edumazet@...gle.com>
Subject: Re: [PATCH net-next v9 2/2] net: ethernet: Add driver for Sunplus
 SP7021

Wells Lu e..h
3i(0 <wells.lu@...plus.com> :
[...]
> I will add disable_irq() and enable_irq() for spl2sw_rx_poll() and spl2sw_tx_poll() as shown below:
> 
> spl2sw_rx_poll():
> 
> 	wmb();	/* make sure settings are effective. */
> 	disable_irq(comm->irq);
> 	mask = readl(comm->l2sw_reg_base + L2SW_SW_INT_MASK_0);
> 	mask &= ~MAC_INT_RX;
> 	writel(mask, comm->l2sw_reg_base + L2SW_SW_INT_MASK_0);
> 	enable_irq(comm->irq);
> 
> spl2sw_tx_poll():
> 
> 	wmb();			/* make sure settings are effective. */
> 	disable_irq(comm->irq);
> 	mask = readl(comm->l2sw_reg_base + L2SW_SW_INT_MASK_0);
> 	mask &= ~MAC_INT_TX;
> 	writel(mask, comm->l2sw_reg_base + L2SW_SW_INT_MASK_0);
> 	enable_irq(comm->irq);
> 
> 
> Is the modification ok?

disable_irq prevents future irq processing but it does not help against irq
code currently running on a different cpu.

You may use plain spin_{lock / unlock} in IRQ context and
spin_{loq_irqsave / irq_restore} in NAPI context.

-- 
Ueimor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ