Skip to content

Commit

Permalink
net: phy: fix aneg restart in phy_ethtool_set_eee
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed May 13, 2020
1 parent 99addbe commit 9de5d23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,11 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data)
/* Restart autonegotiation so the new modes get sent to the
* link partner.
*/
ret = phy_restart_aneg(phydev);
if (ret < 0)
return ret;
if (phydev->autoneg == AUTONEG_ENABLE) {
ret = phy_restart_aneg(phydev);
if (ret < 0)
return ret;
}
}

return 0;
Expand Down

0 comments on commit 9de5d23

Please sign in to comment.