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
| ||
|
Message-ID: <8aebd38cf057cf659d5133527f55e1ced0e6f70c.camel@redhat.com> Date: Thu, 11 May 2023 12:26:34 +0200 From: Paolo Abeni <pabeni@...hat.com> To: Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org Cc: Doug Berger <opendmb@...il.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>, Russell King <linux@...linux.org.uk>, Marek BehĂșn <kabel@...nel.org>, Peter Geis <pgwipeout@...il.com>, Frank <Frank.Sae@...or-comm.com>, open list <linux-kernel@...r.kernel.org> Subject: Re: [PATCH net-next v2 2/3] net: phy: broadcom: Add support for Wake-on-LAN Hi, On Tue, 2023-05-09 at 15:34 -0700, Florian Fainelli wrote: > @@ -821,7 +917,28 @@ static int bcm54xx_phy_probe(struct phy_device *phydev) > if (IS_ERR(priv->ptp)) > return PTR_ERR(priv->ptp); > > - return 0; > + /* We cannot utilize the _optional variant here since we want to know > + * whether the GPIO descriptor exists or not to advertise Wake-on-LAN > + * support or not. > + */ > + wakeup_gpio = devm_gpiod_get(&phydev->mdio.dev, "wakeup", GPIOD_IN); > + if (PTR_ERR(wakeup_gpio) == -EPROBE_DEFER) > + return PTR_ERR(wakeup_gpio); > + > + if (!IS_ERR(wakeup_gpio)) { > + priv->wake_irq = gpiod_to_irq(wakeup_gpio); > + ret = irq_set_irq_type(priv->wake_irq, IRQ_TYPE_LEVEL_LOW); > + if (ret) > + return ret; > + } > + > + /* If we do not have a main interrupt or a side-band wake-up interrupt, > + * then the device cannot be marked as wake-up capable. > + */ > + if (!bcm54xx_phy_can_wakeup(phydev)) > + return ret; AFAICS, as this point 'ret' is 0, so the above is confusing. Do you intend the probe to complete successfully? If so, would not be better/more clear: return 0; ? Thanks, Paolo
Powered by blists - more mailing lists