Skip to content

Commit 4b9235a

Browse files
Russell King (Oracle)Paolo Abeni
Russell King (Oracle)
authored and
Paolo Abeni
committed
net: phy: fix genphy_c45_eee_is_active() for disabled EEE
Commit 809265f ("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) <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 8401171 commit 4b9235a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,9 @@ int genphy_c45_eee_is_active(struct phy_device *phydev, unsigned long *lp)
14791479
__ETHTOOL_DECLARE_LINK_MODE_MASK(common);
14801480
int ret;
14811481

1482+
if (!phydev->eee_cfg.eee_enabled)
1483+
return 0;
1484+
14821485
ret = genphy_c45_read_eee_lpa(phydev, tmp_lp);
14831486
if (ret)
14841487
return ret;

0 commit comments

Comments
 (0)