netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
@ 2017-01-10 23:13 Russell King
  2017-01-10 23:24 ` Florian Fainelli
  2017-01-11 15:03 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Russell King @ 2017-01-10 23:13 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Andrew Lunn, Charles-Antoine Couret, linux-arm-kernel, netdev

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.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/marvell.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 6ad76829c7cd..04e439ad5cff 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1190,7 +1190,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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
  2017-01-10 23:13 [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode Russell King
@ 2017-01-10 23:24 ` Florian Fainelli
  2017-01-11 15:03   ` David Miller
  2017-01-11 15:03 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2017-01-10 23:24 UTC (permalink / raw)
  To: Russell King
  Cc: Andrew Lunn, Charles-Antoine Couret, linux-arm-kernel, netdev

On 01/10/2017 03:13 PM, Russell King wrote:
> 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.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Fixes: 6cfb3bcc0641 ("Marvell phy: check link status in case of fiber
link.")
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
  2017-01-10 23:13 [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode Russell King
  2017-01-10 23:24 ` Florian Fainelli
@ 2017-01-11 15:03 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2017-01-11 15:03 UTC (permalink / raw)
  To: rmk+kernel
  Cc: f.fainelli, andrew, charles-antoine.couret, linux-arm-kernel,
	netdev

From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Tue, 10 Jan 2017 23:13:45 +0000

> 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.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Applied, thanks Russell.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
  2017-01-10 23:24 ` Florian Fainelli
@ 2017-01-11 15:03   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-01-11 15:03 UTC (permalink / raw)
  To: f.fainelli
  Cc: andrew, rmk+kernel, netdev, linux-arm-kernel,
	charles-antoine.couret

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 10 Jan 2017 15:24:11 -0800

> Fixes: 6cfb3bcc0641 ("Marvell phy: check link status in case of fiber
> link.")

Thanks, I added this to Russell's commit message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-11 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-10 23:13 [PATCH] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode Russell King
2017-01-10 23:24 ` Florian Fainelli
2017-01-11 15:03   ` David Miller
2017-01-11 15:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).