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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Mar 2023 14:38:51 +0300
From:   Serge Semin <fancer.lancer@...il.com>
To:     Piotr Raczynski <piotr.raczynski@...el.com>
Cc:     Serge Semin <Sergey.Semin@...kalelectronics.ru>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Jose Abreu <joabreu@...opsys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        Qing Zhang <zhangqing@...ngson.cn>,
        Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
        Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
        Christian Marangi <ansuelsmth@...il.com>,
        Biao Huang <biao.huang@...iatek.com>,
        Yang Yingliang <yangyingliang@...wei.com>,
        netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 13/13] net: dwmac-loongson: Perceive zero IRQ as
 invalid

On Tue, Mar 14, 2023 at 09:20:42AM +0100, Piotr Raczynski wrote:
> On Tue, Mar 14, 2023 at 01:42:37AM +0300, Serge Semin wrote:
> > Linux kernel defines zero IRQ number as invalid in case if IRQ couldn't be
> > mapped. Fix that for Loongson PCI MAC specific IRQs request procedure.
> > 
> 

> Looks a little odd but as I also checked and kernel does seem to treat
> zero as mapping failure instead of -WHATEVER.

See what Linus originally told about that:
https://lore.kernel.org/lkml/Pine.LNX.4.64.0701250940220.25027@woody.linux-foundation.org/

> 
> Fix looks fine.
> 
> Reviewed-by: Piotr Raczynski <piotr.raczynski@...el.com>

Thanks.

-Serge(y)

> 
> > Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
> > Signed-off-by: Serge Semin <Sergey.Semin@...kalelectronics.ru>
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > index a25c187d3185..907bdfcc07e9 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > @@ -127,20 +127,20 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
> >  	res.addr = pcim_iomap_table(pdev)[0];
> >  
> >  	res.irq = of_irq_get_byname(np, "macirq");
> > -	if (res.irq < 0) {
> > +	if (res.irq <= 0) {
> >  		dev_err(&pdev->dev, "IRQ macirq not found\n");
> >  		ret = -ENODEV;
> >  		goto err_disable_msi;
> >  	}
> >  
> >  	res.wol_irq = of_irq_get_byname(np, "eth_wake_irq");
> > -	if (res.wol_irq < 0) {
> > +	if (res.wol_irq <= 0) {
> >  		dev_info(&pdev->dev, "IRQ eth_wake_irq not found, using macirq\n");
> >  		res.wol_irq = res.irq;
> >  	}
> >  
> >  	res.lpi_irq = of_irq_get_byname(np, "eth_lpi");
> > -	if (res.lpi_irq < 0) {
> > +	if (res.lpi_irq <= 0) {
> >  		dev_err(&pdev->dev, "IRQ eth_lpi not found\n");
> >  		ret = -ENODEV;
> >  		goto err_disable_msi;
> > -- 
> > 2.39.2
> > 
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ