Skip to content

Commit

Permalink
net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
Browse files Browse the repository at this point in the history
[ Upstream commit a13c065 ]

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: 6cfb3bc ("Marvell phy: check link status in case of fiber link.")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Russell King authored and Greg Kroah-Hartman committed Jul 5, 2017
1 parent 849f2d0 commit d48cb21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/phy/marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,8 @@ static int marvell_read_status(struct phy_device *phydev)
int err;

/* 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);
if (err < 0)
goto error;
Expand Down

0 comments on commit d48cb21

Please sign in to comment.