lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260114225731.811993-2-maxime.chevallier@bootlin.com>
Date: Wed, 14 Jan 2026 23:57:23 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: davem@...emloft.net,
	Andrew Lunn <andrew@...n.ch>,
	Jakub Kicinski <kuba@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Paolo Abeni <pabeni@...hat.com>,
	Russell King <linux@...linux.org.uk>,
	Jonas Jelonek <jelonek.jonas@...il.com>,
	Florian Fainelli <f.fainelli@...il.com>,
	Heiner Kallweit <hkallweit1@...il.com>
Cc: Maxime Chevallier <maxime.chevallier@...tlin.com>,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	thomas.petazzoni@...tlin.com,
	Simon Horman <horms@...nel.org>,
	Romain Gantois <romain.gantois@...tlin.com>,
	Marek BehĂșn <kabel@...nel.org>,
	bcm-kernel-feedback-list@...adcom.com
Subject: [PATCH net-next 1/6] net: sfp: Add support for SGMII to 100FX modules

There exist some SFP modules that rely on a built-in PHY (usually a
Broadcom BCM5461) to output 100baseFX, using SGMII as the
phy_interface.

This is relevant as there are devices that support SGMII and 1000BaseX,
but not 100FX natively on their SFP cages.

SGMII can be used to convey 100Mbps links with symbol repetition, but the
serdes lane stays clocked at 1.25GHz. We therefore absolutely need a
media-converter to adapt this to 100BaseFX, that runs at 125MHz.

What this means for the sfp-bus infrastructure is that we may have a PHY
to probe when dealing with a 100FX (and possibly a 100LX) module, and if
this PHY exist it will use SGMII.

Signed-off-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
---
 drivers/net/phy/sfp-bus.c | 11 +++++++++++
 drivers/net/phy/sfp.c     |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index b945d75966d5..85c9f21af69b 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -105,6 +105,14 @@ static void sfp_module_parse_may_have_phy(struct sfp_bus *bus,
 		return;
 	}
 
+	/* Some 100M fiber modules have a PHY, acting as an SGMII to 100FX
+	 * media converter.
+	 */
+	if (id->base.e100_base_fx || id->base.e100_base_lx) {
+		bus->caps.may_have_phy = true;
+		return;
+	}
+
 	if (id->base.phys_id != SFF8024_ID_DWDM_SFP) {
 		switch (id->base.extended_cc) {
 		case SFF8024_ECC_10GBASE_T_SFI:
@@ -188,6 +196,9 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
 	if (id->base.e100_base_fx || id->base.e100_base_lx) {
 		phylink_set(modes, 100baseFX_Full);
 		__set_bit(PHY_INTERFACE_MODE_100BASEX, interfaces);
+
+		/* SGMII to 100Base-FX modules with internal PHY */
+		__set_bit(PHY_INTERFACE_MODE_SGMII, interfaces);
 	}
 	if ((id->base.e_base_px || id->base.e_base_bx10) && br_nom == 100) {
 		phylink_set(modes, 100baseFX_Full);
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 84bef5099dda..5b42af1cf6aa 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -2446,7 +2446,8 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report)
 	    sfp->id.base.extended_cc == SFF8024_ECC_5GBASE_T ||
 	    sfp->id.base.extended_cc == SFF8024_ECC_2_5GBASE_T)
 		sfp->mdio_protocol = MDIO_I2C_C45;
-	else if (sfp->id.base.e1000_base_t)
+	else if (sfp->id.base.e1000_base_t || sfp->id.base.e100_base_fx ||
+		 sfp->id.base.e100_base_lx)
 		sfp->mdio_protocol = MDIO_I2C_MARVELL_C22;
 	else
 		sfp->mdio_protocol = MDIO_I2C_NONE;
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ