linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question: pause mode disabled for marvell 88e151x phy
@ 2018-12-15  8:07 Yunsheng Lin
  2018-12-15 10:37 ` Russell King - ARM Linux
  0 siblings, 1 reply; 9+ messages in thread
From: Yunsheng Lin @ 2018-12-15  8:07 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, linux
  Cc: davem, netdev, Weiwei Deng, Yisen.Zhuang, huangdaode, lipeng321,
	salil.mehta, lijianhua 00216010, linux-kernel

Hi, all
	When using the marvel 88e151x phy driver, the pause mode is disabled
by commit 6623c0fba10e when phy is inited as below:

 	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;
 	}


According to the commit log:
"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."

There seems to be some problem with pause subsequent negotiation.
We reverted the above patch and tried to reproduce the above problem
by triggering another negotiation by reconnection of the cable, using
ethtool -a cmd shows both still have tx and rx pause enable.

Some doubt about the above problem:
According to 88e151x datasheet and marvel phy driver in linux, the
88e1512 and 88e1514 support SGMII-to-Copper mode, so commit above
disables the pause support for all 88e151x phy using SGMII-to-Copper
mode.

1. Does all the 88e151x supporting SGMII-to-Copper have the above problem?

2. If not, can we use revision id field in phydev->phy_id to only disable
   the pause support for specific 88e151x phy? We can not find some useful
   revision info in datasheet, and by printing the phy id when phy init, we
   are able to find that the phy we are using has a phy id as 0x1d10dd1,
   which has revision id as 0x1.

3. Does this problem only happen marvel 88e1512 phy with some specific partner
   phy? We are unable to reproduce this problem, so any suggestion to reproduce
   this would be very helpful to us too.

4. Also the commit disables the pause support completely, if using revision id
   can not aviod this problem, can we only disable pause support when negotiation
   by only clearing pause support in phydev->advertising, but not phydev->supported?

If there are any better info or suggestion regarding this problem, it would be very
helpful, thanks in advance.

reference:
[1] https://lists.openwall.net/netdev/2017/12/15/174
[2] https://web.pa.msu.edu/hep/atlas/l1calo/htm/hardware/components/Enet_Phy/marvell_alaska_phy_88e151x_datasheet_jan18.pdf


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

end of thread, other threads:[~2019-01-24 12:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15  8:07 Question: pause mode disabled for marvell 88e151x phy Yunsheng Lin
2018-12-15 10:37 ` Russell King - ARM Linux
2018-12-17  9:42   ` Yunsheng Lin
2018-12-17 14:36     ` Russell King - ARM Linux
2018-12-18  9:34       ` Yunsheng Lin
2018-12-18 10:08         ` Russell King - ARM Linux
2019-01-05  3:28       ` Yunsheng Lin
2019-01-23 22:41         ` Russell King - ARM Linux admin
2019-01-24 12:28           ` Yunsheng Lin

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