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]
Message-ID: <Z0HgsAJWcJ_JzUxG@shell.armlinux.org.uk>
Date: Sat, 23 Nov 2024 14:03:28 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net v2] net: phy: fix phy_ethtool_set_eee() incorrectly
 enabling LPI

On Fri, Nov 22, 2024 at 09:28:04PM +0100, Heiner Kallweit wrote:
> On 22.11.2024 21:04, Heiner Kallweit wrote:
> > This part collides with a pending patch:
> > https://patchwork.kernel.org/project/netdevbpf/patch/a5efc274-ce58-49f3-ac8a-5384d9b41695@gmail.com/
> > I think you have to rebase and resubmit once the pending patch has been applied.
> 
> Merge of both changes should result in something like this:
> 
> static void phy_ethtool_set_eee_noneg(struct phy_device *phydev,
>                                       const struct eee_config *old_cfg)
> {
>         bool enable_tx_lpi;
> 
>         if (!phydev->link)
>                 return;
> 
>         enable_tx_lpi = phydev->eee_cfg.tx_lpi_enabled && phydev->eee_active;
> 
>         if (enable_tx_lpi != old_cfg->tx_lpi_enabled ||
>             phydev->eee_cfg.tx_lpi_timer != old_cfg->tx_lpi_timer) {
>                 phydev->enable_tx_lpi = false;
>                 phydev->link = false;
>                 phy_link_down(phydev);
>                 phydev->enable_tx_lpi = enable_tx_lpi;
>                 phydev->link = true;
>                 phy_link_up(phydev);
>         }
> }

Thanks for pointing this out - I've now merged your patch into my tree
and rebased on top. Your resolution isn't quite right - the if()
statement should be:

+       if (phydev->enable_tx_lpi != enable_tx_lpi ||
            phydev->eee_cfg.tx_lpi_timer != old_cfg->tx_lpi_timer) {

Since we only need to bounce the link if the LPI timer or the MAC LPI
enable state has changed. I'll send a replacement patch shortly.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ