Skip to contentSkip to conversation

net: phy: marvell: avoid pause mode on SGMII-to-Copper for 88e151x

PATCH In review Russell King 4 participants 6 messages Dec 13, 2017 – Dec 15, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: marvell: avoid pause mode on SGMII-to-Copper for 88e151x

Observed on the 88e1512 in SGMII-to-Copper mode, negotiating pause is unreliable. While the pause bits can be set in the advertisment register, they clear shortly after negotiation with a link partner commences irrespective of the cause of the negotiation.

While these bits may be correctly conveyed to the link partner on the first negotiation, a subsequent negotiation (eg, due to negotiation restart by the link partner, or reconnection of the cable) will result in the link partner seeing these bits as zero, while the kernel believes that it has advertised pause modes.

This leads to the local kernel evaluating (eg) symmetric pause mode, while the remote end evaluates that we have no pause mode capability.

Since we can't guarantee the advertisment, disable pause mode support with this PHY when used in SGMII-to-Copper mode.

The 88e1510 in RGMII-to-Copper mode appears to behave correctly.

---
 drivers/net/phy/marvell.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/phy/marvell.c +10 -0
index 710110ead6ad..f4d25ac85e30 100644
@@ -924,6 +924,16 @@ static int m88e1510_config_init(struct phy_device *phydev)
 		err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
 		if (err < 0)
 			return err;
+
+		/* There appears to be a bug in the 88e1512 when used in
+		 * SGMII to copper mode, where the AN advertisment register
+		 * clears the pause bits each time a negotiation occurs.
+		 * This means we can never be truely sure what was advertised,
+		 * so disable Pause support.
+		 */
+		pause = SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+		phydev->supported &= ~pause;
+		phydev->advertising &= ~pause;
 	}
 
 	return m88e1121_config_init(phydev);
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Russell King

Observed on the 88e1512 in SGMII-to-Copper mode, negotiating pause is unreliable. While the pause bits can be set in the advertisment register, they clear shortly after negotiation with a link partner commences irrespective of the cause of the negotiation.

While these bits may be correctly conveyed to the link partner on the first negotiation, a subsequent negotiation (eg, due to negotiation restart by the link partner, or reconnection of the cable) will result in the link partner seeing these bits as zero, while the kernel believes that it has advertised pause modes.

This leads to the local kernel evaluating (eg) symmetric pause mode, while the remote end evaluates that we have no pause mode capability.

Quoted 6 lines

Since we can't guarantee the advertisment, disable pause mode support with this PHY when used in SGMII-to-Copper mode.

The 88e1510 in RGMII-to-Copper mode appears to behave correctly.

Andrew

maintainer
#2 lore raw
In reply to Russell King

From: Russell King <[email protected]>
Date: Wed, 13 Dec 2017 09:22:09 +0000

Quoted 6 lines
drivers/net/phy/marvell.c +2 -0
@@ -924,6 +924,16 @@ static int m88e1510_config_init(struct phy_device *phydev)
 		err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
 		if (err < 0)
 			return err;
+
+		/* There appears to be a bug in the 88e1512 when used in

drivers/net/phy/marvell.c static int m88e1510_config_init(struct phy_device *phydev) · line 938

Quoted 10 lines
drivers/net/phy/marvell.c +8 -0
+		 * SGMII to copper mode, where the AN advertisment register
+		 * clears the pause bits each time a negotiation occurs.
+		 * This means we can never be truely sure what was advertised,
+		 * so disable Pause support.
+		 */
+		pause = SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+		phydev->supported &= ~pause;
+		phydev->advertising &= ~pause;
 	}
 

This function doesn't have a local 'pause' variable in any of my trees.

I wonder what you generated this against, and even more importantly, what tree the reviewers were considering when looking at this patch :)

reviewer Reviewed-by Andrew Lunn
#3 lore raw
Quoted 22 lines · David Miller

From: Russell King <[email protected]>
Date: Wed, 13 Dec 2017 09:22:09 +0000

Quoted 6 lines
(quoted diff) +2 -0
@@ -924,6 +924,16 @@ static int m88e1510_config_init(struct phy_device *phydev)
 		err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
 		if (err < 0)
 			return err;
+
+		/* There appears to be a bug in the 88e1512 when used in

Review static int m88e1510_config_init(struct phy_device *phydev) · line 938

Quoted 10 lines
(quoted diff) +8 -0
+		 * SGMII to copper mode, where the AN advertisment register
+		 * clears the pause bits each time a negotiation occurs.
+		 * This means we can never be truely sure what was advertised,
+		 * so disable Pause support.
+		 */
+		pause = SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+		phydev->supported &= ~pause;
+		phydev->advertising &= ~pause;
 	}
 

This function doesn't have a local 'pause' variable in any of my trees.

Quoted 2 lines

I wonder what you generated this against, and even more importantly, what tree the reviewers were considering when looking at this patch :)

Sorry about that, not quite sure how that happened, but here's a replacement patch. I assume patchwork will do the right thing by including the patch in this mail...

8<====
From: Russell King <[email protected]>
Subject: [PATCH] net: phy: marvell: avoid pause mode on SGMII-to-Copper for
88e151x

Observed on the 88e1512 in SGMII-to-Copper mode, negotiating pause is unreliable. While the pause bits can be set in the advertisment register, they clear shortly after negotiation with a link partner commences irrespective of the cause of the negotiation.

While these bits may be correctly conveyed to the link partner on the first negotiation, a subsequent negotiation (eg, due to negotiation restart by the link partner, or reconnection of the cable) will result in the link partner seeing these bits as zero, while the kernel believes that it has advertised pause modes.

This leads to the local kernel evaluating (eg) symmetric pause mode, while the remote end evaluates that we have no pause mode capability.

Since we can't guarantee the advertisment, disable pause mode support with this PHY when used in SGMII-to-Copper mode.

The 88e1510 in RGMII-to-Copper mode appears to behave correctly.

---
 drivers/net/phy/marvell.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/phy/marvell.c +12 -0
index b5a8f750e433..2510acc0feb0 100644
@@ -879,6 +879,8 @@ static int m88e1510_config_init(struct phy_device *phydev)
 
 	/* SGMII-to-Copper mode initialization */
 	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+		u32 pause;
+
 		/* Select page 18 */
 		err = marvell_set_page(phydev, 18);
 		if (err < 0)
@@ -902,6 +904,16 @@ static int m88e1510_config_init(struct phy_device *phydev)
 		err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
 		if (err < 0)
 			return err;
+
+		/* There appears to be a bug in the 88e1512 when used in
+		 * SGMII to copper mode, where the AN advertisment register
+		 * clears the pause bits each time a negotiation occurs.
+		 * This means we can never be truely sure what was advertised,
+		 * so disable Pause support.
+		 */
+		pause = SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+		phydev->supported &= ~pause;
+		phydev->advertising &= ~pause;
 	}
 
 	return m88e1121_config_init(phydev);
Signature · 8 lines
2.7.4



-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
maintainer
#4 lore raw
Quoted 3 lines

Sorry about that, not quite sure how that happened, but here's a replacement patch. I assume patchwork will do the right thing by including the patch in this mail...

Hi Russell

No, it does not. You need to submit a whole new patch.

Andrew

maintainer
#5 lore raw
In reply to Russell King - ARM Linux

From: Russell King - ARM Linux <[email protected]>
Date: Fri, 15 Dec 2017 15:45:40 +0000

Quoted 3 lines

Sorry about that, not quite sure how that happened, but here's a replacement patch. I assume patchwork will do the right thing by including the patch in this mail...

Please use fresh patch postings when posting a new or fixed version of a patch.

Otherwsie I have to manually edit what ends up in patchwork in order to get rid of the quoted discussion text and other irrelevant material in the commit message.

Thank you.