Commit d48cb21f authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman

net: phy: marvell: fix Marvell 88E1512 used in SGMII mode


[ Upstream commit a13c0652 ]

When an Marvell 88E1512 PHY is connected to a nic in SGMII mode, the
fiber page is used for the SGMII host-side connection.  The PHY driver
notices that SUPPORTED_FIBRE is set, so it tries reading the fiber page
for the link status, and ends up reading the MAC-side status instead of
the outgoing (copper) link.  This leads to incorrect results reported
via ethtool.

If the PHY is connected via SGMII to the host, ignore the fiber page.
However, continue to allow the existing power management code to
suspend and resume the fiber page.

Fixes: 6cfb3bcc ("Marvell phy: check link status in case of fiber link.")
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 849f2d06
...@@ -1200,7 +1200,8 @@ static int marvell_read_status(struct phy_device *phydev) ...@@ -1200,7 +1200,8 @@ static int marvell_read_status(struct phy_device *phydev)
int err; int err;
/* Check the fiber mode first */ /* Check the fiber mode first */
if (phydev->supported & SUPPORTED_FIBRE) { if (phydev->supported & SUPPORTED_FIBRE &&
phydev->interface != PHY_INTERFACE_MODE_SGMII) {
err = phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_M1111_FIBER); err = phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_M1111_FIBER);
if (err < 0) if (err < 0)
goto error; goto error;
......
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