diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2020-04-23 10:57:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-24 01:55:35 +0300 |
commit | 796a8fa28980050bf1995617f0876484f3dc1026 (patch) | |
tree | e2410bcd5257fe8cb1ff1b21f7e985a19f77695d /drivers/net | |
parent | d97793af11e48161dee00fa877e34b65e7a20da9 (diff) | |
download | linux-796a8fa28980050bf1995617f0876484f3dc1026.tar.xz |
net: phy: bcm84881: clear settings on link down
Clear the link partner advertisement, speed, duplex and pause when
the link goes down, as other phylib drivers do. This avoids the
stale link partner, speed and duplex settings being reported via
ethtool.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/bcm84881.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/phy/bcm84881.c b/drivers/net/phy/bcm84881.c index 3840d2adbbb9..9717a1626f3f 100644 --- a/drivers/net/phy/bcm84881.c +++ b/drivers/net/phy/bcm84881.c @@ -155,9 +155,6 @@ static int bcm84881_read_status(struct phy_device *phydev) if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete) phydev->link = false; - if (!phydev->link) - return 0; - linkmode_zero(phydev->lp_advertising); phydev->speed = SPEED_UNKNOWN; phydev->duplex = DUPLEX_UNKNOWN; @@ -165,6 +162,9 @@ static int bcm84881_read_status(struct phy_device *phydev) phydev->asym_pause = 0; phydev->mdix = 0; + if (!phydev->link) + return 0; + if (phydev->autoneg_complete) { val = genphy_c45_read_lpa(phydev); if (val < 0) |