[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1ttmWN-0077Mb-Q6@rmk-PC.armlinux.org.uk>
Date: Sun, 16 Mar 2025 11:51:11 +0000
From: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>
Subject: [PATCH net-next] net: phy: fix genphy_c45_eee_is_active() for
disabled EEE
Commit 809265fe96fe ("net: phy: c45: remove local advertisement
parameter from genphy_c45_eee_is_active") stopped reading the local
advertisement from the PHY earlier in this development cycle, which
broke "ethtool --set-eee ethX eee off".
When ethtool is used to set EEE off, genphy_c45_eee_is_active()
indicates that EEE was active if the link partner reported an
advertisement, which causes phylib to set phydev->enable_tx_lpi on
link up, despite our local advertisement in hardware being empty.
However, phydev->advertising_eee is preserved while EEE is turned off,
which leads to genphy_c45_eee_is_active() incorrectly reporting that
EEE is active.
Fix it by checking phydev->eee_cfg.eee_enabled, and if clear,
immediately indicate that EEE is not active.
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
---
drivers/net/phy/phy-c45.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 0bcbdce38107..f1973ed90072 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1476,6 +1476,9 @@ int genphy_c45_eee_is_active(struct phy_device *phydev, unsigned long *lp)
__ETHTOOL_DECLARE_LINK_MODE_MASK(common);
int ret;
+ if (!phydev->eee_cfg.eee_enabled)
+ return 0;
+
ret = genphy_c45_read_eee_lpa(phydev, tmp_lp);
if (ret)
return ret;
--
2.30.2
Powered by blists - more mailing lists