Skip to content

Commit 9de5d23

Browse files
hkallweitdavem330
authored andcommitted
net: phy: fix aneg restart in phy_ethtool_set_eee
phy_restart_aneg() enables aneg in the PHY. That's not what we want if phydev->autoneg is disabled. In this case still update EEE advertisement register, but don't enable aneg and don't trigger an aneg restart. Fixes: f75abeb ("net: phy: restart phy autonegotiation after EEE advertisment change") Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 99addbe commit 9de5d23

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎drivers/net/phy/phy.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,9 +1132,11 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data)
11321132
/* Restart autonegotiation so the new modes get sent to the
11331133
* link partner.
11341134
*/
1135-
ret = phy_restart_aneg(phydev);
1136-
if (ret < 0)
1137-
return ret;
1135+
if (phydev->autoneg == AUTONEG_ENABLE) {
1136+
ret = phy_restart_aneg(phydev);
1137+
if (ret < 0)
1138+
return ret;
1139+
}
11381140
}
11391141

11401142
return 0;

0 commit comments

Comments
 (0)