netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: marvell: Ensure SGMII auto-negotiation is enabled for 88E1111
@ 2021-02-13  0:26 Robert Hancock
  2021-02-13  1:09 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2021-02-13  0:26 UTC (permalink / raw)
  To: andrew, hkallweit1, davem, kuba; +Cc: linux, netdev, Robert Hancock

When 88E111 is operating in SGMII mode, auto-negotiation should be enabled
on the SGMII side so that the link will come up properly with PCSes which
normally have auto-negotiation enabled. This is normally the case when the
PHY defaults to SGMII mode at power-up, however if we switched it from some
other mode like 1000BaseX, as may happen in some SFP module situations,
it may not be.

Call genphy_check_and_restart_aneg on the fiber page to ensure that auto-
negotiation is properly enabled on the SGMII interface.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/net/phy/marvell.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 3238d0fbf437..e26a5d663f8a 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -684,16 +684,19 @@ static int m88e1111_config_aneg(struct phy_device *phydev)
 	if (err < 0)
 		goto error;
 
-	/* Do not touch the fiber page if we're in copper->sgmii mode */
-	if (phydev->interface == PHY_INTERFACE_MODE_SGMII)
-		return 0;
-
 	/* Then the fiber link */
 	err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
 	if (err < 0)
 		goto error;
 
-	err = marvell_config_aneg_fiber(phydev);
+	if (phydev->interface == PHY_INTERFACE_MODE_SGMII)
+		/* Do not touch the fiber advertisement if we're in copper->sgmii mode.
+		 * Just ensure that SGMII-side autonegotiation is enabled.
+		 * If we switched from some other mode to SGMII it may not be.
+		 */
+		err = genphy_check_and_restart_aneg(phydev, false);
+	else
+		err = marvell_config_aneg_fiber(phydev);
 	if (err < 0)
 		goto error;
 
-- 
2.27.0


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

* Re: [PATCH net-next] net: phy: marvell: Ensure SGMII auto-negotiation is enabled for 88E1111
  2021-02-13  0:26 [PATCH net-next] net: phy: marvell: Ensure SGMII auto-negotiation is enabled for 88E1111 Robert Hancock
@ 2021-02-13  1:09 ` Russell King - ARM Linux admin
  2021-02-13  1:28   ` Robert Hancock
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-13  1:09 UTC (permalink / raw)
  To: Robert Hancock; +Cc: andrew, hkallweit1, davem, kuba, netdev

On Fri, Feb 12, 2021 at 06:26:29PM -0600, Robert Hancock wrote:
> When 88E111 is operating in SGMII mode, auto-negotiation should be enabled

88E1111.

> on the SGMII side so that the link will come up properly with PCSes which
> normally have auto-negotiation enabled. This is normally the case when the
> PHY defaults to SGMII mode at power-up, however if we switched it from some
> other mode like 1000BaseX, as may happen in some SFP module situations,
> it may not be.

Do you actually have a module where this applies?

I have modules that do come up in 1000base-X mode, but do switch to
SGMII mode with AN just fine. So I'm wondering what the difference is.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH net-next] net: phy: marvell: Ensure SGMII auto-negotiation is enabled for 88E1111
  2021-02-13  1:09 ` Russell King - ARM Linux admin
@ 2021-02-13  1:28   ` Robert Hancock
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Hancock @ 2021-02-13  1:28 UTC (permalink / raw)
  To: linux; +Cc: hkallweit1, davem, kuba, andrew, netdev

On Sat, 2021-02-13 at 01:09 +0000, Russell King - ARM Linux admin wrote:
> On Fri, Feb 12, 2021 at 06:26:29PM -0600, Robert Hancock wrote:
> > When 88E111 is operating in SGMII mode, auto-negotiation should be enabled
> 
> 88E1111.

yup..

> 
> > on the SGMII side so that the link will come up properly with PCSes which
> > normally have auto-negotiation enabled. This is normally the case when the
> > PHY defaults to SGMII mode at power-up, however if we switched it from some
> > other mode like 1000BaseX, as may happen in some SFP module situations,
> > it may not be.
> 
> Do you actually have a module where this applies?
> 
> I have modules that do come up in 1000base-X mode, but do switch to
> SGMII mode with AN just fine. So I'm wondering what the difference is.

I saw this with a Finisar FCLF8520P2BTL, which defaults to 1000Base-X with
host-side auto-negotiation disabled. So presumably the auto-negotiation
disabled state carries over when it is switched to SGMII mode. I previously
wrote a patch ("net: phy: marvell: add special handling of Finisar modules with
88E1111") which enabled auto-negotiation for 1000Base-X mode, but we are trying
to switch over to using SGMII with these now.

> 
-- 
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies
www.calian.com

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

end of thread, other threads:[~2021-02-13  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13  0:26 [PATCH net-next] net: phy: marvell: Ensure SGMII auto-negotiation is enabled for 88E1111 Robert Hancock
2021-02-13  1:09 ` Russell King - ARM Linux admin
2021-02-13  1:28   ` Robert Hancock

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).