Skip to content

Commit b82cf17

Browse files
Russell Kingdavem330
Russell King
authored andcommitted
net: phy: marvell: don't interpret PHY status unless resolved
Don't attempt to interpret the PHY specific status register unless the PHY is indicating that the resolution is valid. Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Russell King <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e387f7d commit b82cf17

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/phy/marvell.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,9 @@ static int marvell_read_status_page_an(struct phy_device *phydev,
13061306
}
13071307
}
13081308

1309+
if (!(status & MII_M1011_PHY_STATUS_RESOLVED))
1310+
return 0;
1311+
13091312
if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
13101313
phydev->duplex = DUPLEX_FULL;
13111314
else
@@ -1365,6 +1368,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
13651368
linkmode_zero(phydev->lp_advertising);
13661369
phydev->pause = 0;
13671370
phydev->asym_pause = 0;
1371+
phydev->speed = SPEED_UNKNOWN;
1372+
phydev->duplex = DUPLEX_UNKNOWN;
13681373

13691374
if (phydev->autoneg == AUTONEG_ENABLE)
13701375
err = marvell_read_status_page_an(phydev, fiber, status);

0 commit comments

Comments
 (0)