diff mbox

[SRU,Yakkety,hwe-edge,1/2] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode

Message ID e0ed2abfd1418cf3d933a73d2260b4f2d9fccaef.1495019090.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury May 17, 2017, 11:16 a.m. UTC
From: Russell King <rmk+kernel@armlinux.org.uk>

BugLink: http://bugs.launchpad.net/bugs/1686305

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: 6cfb3bcc0641 ("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>
(cherry picked from commit a13c06525ab9ff442924e67df9393a5efa914c56)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/net/phy/marvell.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Bader May 31, 2017, 7:15 a.m. UTC | #1
clean cherry-pick and in zesty already (so should be in hwe-edge, too).
Thadeu Lima de Souza Cascardo May 31, 2017, 11:48 a.m. UTC | #2
Applied to yakkety master-next branch.

Thanks.
Cascardo.
diff mbox

Patch

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index c2dcf02..5960690 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1194,7 +1194,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;