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: <20220620193318.GA15322@wunner.de>
Date:   Mon, 20 Jun 2022 21:33:18 +0200
From:   Lukas Wunner <lukas@...ner.de>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
        linux-usb@...r.kernel.org,
        Steve Glendinning <steve.glendinning@...well.net>,
        UNGLinuxDriver@...rochip.com, Oliver Neukum <oneukum@...e.com>,
        Andre Edich <andre.edich@...rochip.com>,
        Oleksij Rempel <linux@...pel-privat.de>,
        Martyn Welch <martyn.welch@...labora.com>,
        Gabriel Hojda <ghojda@...urs.ro>,
        Christoph Fritz <chf.fritz@...glemail.com>,
        Lino Sanfilippo <LinoSanfilippo@....de>,
        Philipp Rosenberger <p.rosenberger@...bus.com>,
        Simon Han <z.han@...bus.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Russell King <linux@...linux.org.uk>,
        Ferry Toth <fntoth@...il.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH net] net: phy: smsc: Disable Energy Detect Power-Down in
 interrupt mode

On Mon, Jun 20, 2022 at 10:03:26AM -0700, Florian Fainelli wrote:
> On 6/20/22 04:04, Lukas Wunner wrote:
> > --- a/drivers/net/phy/smsc.c
> > +++ b/drivers/net/phy/smsc.c
> > @@ -110,7 +110,7 @@ static int smsc_phy_config_init(struct phy_device *phydev)
> >   	struct smsc_phy_priv *priv = phydev->priv;
> >   	int rc;
> > -	if (!priv->energy_enable)
> > +	if (!priv->energy_enable || phydev->irq != PHY_POLL)
> 
> phy_interrupt_is_valid() may be more appropriate, since you are assuming
> that you either have PHY_POLL or valid "external" PHY interrupt but there is
> also the special case of PHY_MAC_INTERRUPT that is not dealt with.

I deliberately disable EDPD for PHY_MAC_INTERRUPT as well.

That's a proper interrupt, i.e. the PHY signals interrupts
to the MAC (e.g. through an interrupt pin on the MAC),
which forwards the interrupts to phylib.  EDPD cannot
be used in that situation either.


> > @@ -217,7 +219,7 @@ static int lan87xx_read_status(struct phy_device *phydev)
> >   	int err = genphy_read_status(phydev);
> > -	if (!phydev->link && priv->energy_enable) {
> > +	if (!phydev->link && priv->energy_enable && phydev->irq == PHY_POLL) {
> 
> phy_polling_mode()?

Personally I think checking for PHY_POLL is succinct,
but if you or anyone else feels strongly about it
I'll be happy to add such a static inline to
include/linux/phy.h.

Thanks,

Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ