Commit b82cf17f authored by Russell King's avatar Russell King Committed by David S. Miller

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: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e387f7d5
...@@ -1306,6 +1306,9 @@ static int marvell_read_status_page_an(struct phy_device *phydev, ...@@ -1306,6 +1306,9 @@ static int marvell_read_status_page_an(struct phy_device *phydev,
} }
} }
if (!(status & MII_M1011_PHY_STATUS_RESOLVED))
return 0;
if (status & MII_M1011_PHY_STATUS_FULLDUPLEX) if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
phydev->duplex = DUPLEX_FULL; phydev->duplex = DUPLEX_FULL;
else else
...@@ -1365,6 +1368,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page) ...@@ -1365,6 +1368,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
linkmode_zero(phydev->lp_advertising); linkmode_zero(phydev->lp_advertising);
phydev->pause = 0; phydev->pause = 0;
phydev->asym_pause = 0; phydev->asym_pause = 0;
phydev->speed = SPEED_UNKNOWN;
phydev->duplex = DUPLEX_UNKNOWN;
if (phydev->autoneg == AUTONEG_ENABLE) if (phydev->autoneg == AUTONEG_ENABLE)
err = marvell_read_status_page_an(phydev, fiber, status); err = marvell_read_status_page_an(phydev, fiber, status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment