diff mbox series

net: sfp: relax bitrate-derived mode check

Message ID 20210412162611.17441-1-pali@kernel.org
State New
Headers show
Series net: sfp: relax bitrate-derived mode check | expand

Commit Message

Pali Rohár April 12, 2021, 4:26 p.m. UTC
From: Russell King <rmk+kernel@armlinux.org.uk>

[ Upstream commit 7a77233ec6d114322e2c4f71b4e26dbecd9ea8a7 ]

Do not check the encoding when deriving 1000BASE-X from the bitrate
when no other modes are discovered. Some GPON modules (VSOL V2801F
and CarlitoxxPro CPGOS03-0490 v2.0) indicate NRZ encoding with a
1200Mbaud bitrate, but should be driven with 1000BASE-X on the host
side.

Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
Please apply this commit to all stable releases where was already
backported commit 0d035bed2a4a6c4878518749348be61bf082d12a
("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround")
as it depends on this commit. If I checked it correctly patch should
go into 5.10 release.
---
 drivers/net/phy/sfp-bus.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Greg KH April 15, 2021, 1:54 p.m. UTC | #1
On Mon, Apr 12, 2021 at 06:26:11PM +0200, Pali Rohár wrote:
> From: Russell King <rmk+kernel@armlinux.org.uk>

> 

> [ Upstream commit 7a77233ec6d114322e2c4f71b4e26dbecd9ea8a7 ]

> 

> Do not check the encoding when deriving 1000BASE-X from the bitrate

> when no other modes are discovered. Some GPON modules (VSOL V2801F

> and CarlitoxxPro CPGOS03-0490 v2.0) indicate NRZ encoding with a

> 1200Mbaud bitrate, but should be driven with 1000BASE-X on the host

> side.

> 

> Tested-by: Pali Rohár <pali@kernel.org>

> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

> Signed-off-by: David S. Miller <davem@davemloft.net>

> ---

> Please apply this commit to all stable releases where was already

> backported commit 0d035bed2a4a6c4878518749348be61bf082d12a

> ("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround")

> as it depends on this commit. If I checked it correctly patch should

> go into 5.10 release.


Now applied, thanks.

greg k-h
diff mbox series

Patch

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index 58014feedf6c..20b91f5dfc6e 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -334,14 +334,13 @@  void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
 	}
 
 	/* If we haven't discovered any modes that this module supports, try
-	 * the encoding and bitrate to determine supported modes. Some BiDi
-	 * modules (eg, 1310nm/1550nm) are not 1000BASE-BX compliant due to
-	 * the differing wavelengths, so do not set any transceiver bits.
+	 * the bitrate to determine supported modes. Some BiDi modules (eg,
+	 * 1310nm/1550nm) are not 1000BASE-BX compliant due to the differing
+	 * wavelengths, so do not set any transceiver bits.
 	 */
 	if (bitmap_empty(modes, __ETHTOOL_LINK_MODE_MASK_NBITS)) {
-		/* If the encoding and bit rate allows 1000baseX */
-		if (id->base.encoding == SFF8024_ENCODING_8B10B && br_nom &&
-		    br_min <= 1300 && br_max >= 1200)
+		/* If the bit rate allows 1000baseX */
+		if (br_nom && br_min <= 1300 && br_max >= 1200)
 			phylink_set(modes, 1000baseX_Full);
 	}