Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Russell King and committed by
David S. Miller
796a8fa2 d97793af

+3 -3
+3 -3
drivers/net/phy/bcm84881.c
··· 155 155 if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete) 156 156 phydev->link = false; 157 157 158 - if (!phydev->link) 159 - return 0; 160 - 161 158 linkmode_zero(phydev->lp_advertising); 162 159 phydev->speed = SPEED_UNKNOWN; 163 160 phydev->duplex = DUPLEX_UNKNOWN; 164 161 phydev->pause = 0; 165 162 phydev->asym_pause = 0; 166 163 phydev->mdix = 0; 164 + 165 + if (!phydev->link) 166 + return 0; 167 167 168 168 if (phydev->autoneg_complete) { 169 169 val = genphy_c45_read_lpa(phydev);