aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2015-01-26 19:58:15 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-27 03:27:08 -0500
commit9b3320ef702d1c7daf165d5c72c945f0be6b2bed (patch)
treebd2b07eabd86f7d35d8aa6dff82f09b5b03d232c
parent28f323b3bcad4f18106153d177960292e8b2b240 (diff)
net: phy: Invalidate LP advertising flags when restarting or disabling AN
It is possible to see the old value of the LP advertising flags through ethtool after reconfiguring the PHY and before autonegotiation completes. If autonegotiation is turned off then the last value seen will persist indefinitely. Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/phy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 767cd110f496..cdcac6aa4260 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -439,6 +439,9 @@ int phy_start_aneg(struct phy_device *phydev)
439 if (AUTONEG_DISABLE == phydev->autoneg) 439 if (AUTONEG_DISABLE == phydev->autoneg)
440 phy_sanitize_settings(phydev); 440 phy_sanitize_settings(phydev);
441 441
442 /* Invalidate LP advertising flags */
443 phydev->lp_advertising = 0;
444
442 err = phydev->drv->config_aneg(phydev); 445 err = phydev->drv->config_aneg(phydev);
443 if (err < 0) 446 if (err < 0)
444 goto out_unlock; 447 goto out_unlock;