]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: phy: Invalidate LP advertising flags when restarting or disabling AN
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Tue, 27 Jan 2015 00:58:15 +0000 (00:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jan 2015 08:27:08 +0000 (00:27 -0800)
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>
drivers/net/phy/phy.c

index 767cd110f49688d2b4118ba4dffc1a373972e56d..cdcac6aa4260b32927d7c903e024b42e5d17861e 100644 (file)
@@ -439,6 +439,9 @@ int phy_start_aneg(struct phy_device *phydev)
        if (AUTONEG_DISABLE == phydev->autoneg)
                phy_sanitize_settings(phydev);
 
+       /* Invalidate LP advertising flags */
+       phydev->lp_advertising = 0;
+
        err = phydev->drv->config_aneg(phydev);
        if (err < 0)
                goto out_unlock;