Commit 9de5d235 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

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: f75abeb8 ("net: phy: restart phy autonegotiation after EEE advertisment change")
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99addbe3
...@@ -1132,9 +1132,11 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data) ...@@ -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 /* Restart autonegotiation so the new modes get sent to the
* link partner. * link partner.
*/ */
ret = phy_restart_aneg(phydev); if (phydev->autoneg == AUTONEG_ENABLE) {
if (ret < 0) ret = phy_restart_aneg(phydev);
return ret; if (ret < 0)
return ret;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment