diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2020-05-12 21:45:53 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-13 15:21:59 -0700 |
commit | 9de5d235b60a7cdfcdd5461e70c5663e713fde87 (patch) | |
tree | 4726b8d7bc1718eb41d58fd807c1cd631942d0bc /drivers/net/phy/phy.c | |
parent | 99addbe31f5524494f4d7077bcb3f6fa64c5d160 (diff) | |
download | linux-9de5d235b60a7cdfcdd5461e70c5663e713fde87.tar.bz2 |
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: f75abeb8338e ("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>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 72c69a9c8a98..20ca6418f7bc 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -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; |