* [PATCH net-next v4 0/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T
@ 2026-11-21 9:12 Daniel Pawlik
2026-11-21 9:12 ` [PATCH net-next v4 1/2] net: sfp: move sfp_strlen() above the quirk fixups Daniel Pawlik
2026-11-21 9:12 ` [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik
0 siblings, 2 replies; 7+ messages in thread
From: Daniel Pawlik @ 2026-11-21 9:12 UTC (permalink / raw)
To: andrew, hkallweit1, linux
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms,
kabel, petr.wozniak, maxime.chevallier, olek2, Daniel Pawlik
Some "OEM SFP-10G-T" copper modules have no RollBall I2C-to-MDIO
bridge, but the SFP-10G-T quirk forces RollBall on all of them. The PHY
probe then retries for over nine minutes under rtnl_lock before the
module links up without a PHY. This series skips the PHY probe for the
bridge-less revisions A and B, and leaves other revisions, which do
have a bridge, unchanged.
Patch 1 moves sfp_strlen() so the fixup can use it, with no functional
change. Patch 2 adds the fixup.
This does not re-introduce the generic RollBall bridge probe reverted
in commit b521003c27eb ("Revert "net: phy: sfp: probe for RollBall
I2C-to-MDIO bridge in mdio-i2c""): the probe path, its timeouts and the
MDIO bus creation for genuine RollBall modules are untouched. Further
bridge-less revisions of this part number may exist; they can be added
once their lack of a bridge is confirmed on hardware.
This series is based on net-next. Patch 2 has a trivial context conflict
in the quirk table with the pending "net: sfp: add ODI quirk and sort
SFP quirk entries" series [1]; I can rebase whichever lands second.
[1] https://lore.kernel.org/netdev/20261118162323.436219-1-github@bumblecito.com/
Changes in v4:
- Use dev_dbg() instead of dev_info() in the fixup, quirks do not print
anything (Andrew Lunn).
- Collect Reviewed-by on patch 1.
Changes in v3:
- Target net-next and drop the Fixes: tag: rev A never worked without
the stall, so this is not a regression (Andrew Lunn).
- Split the sfp_strlen() move into its own patch (Andrew Lunn).
Changes in v2:
- Match the vendor revision with sfp_strlen(), so NUL-padded revisions
are accepted like the rest of the quirk matching.
- Spell out in the commit message how the rev B module reaches this
quirk entry (its part number depends on the peer speed).
v3: https://lore.kernel.org/netdev/20261120063756.3677554-1-pawlik.dan@gmail.com/
v2: https://lore.kernel.org/netdev/20261118221450.1764790-1-pawlik.dan@gmail.com/
v1: https://lore.kernel.org/netdev/20261116093605.294365-1-pawlik.dan@gmail.com/
Daniel Pawlik (2):
net: sfp: move sfp_strlen() above the quirk fixups
net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and
B
drivers/net/phy/sfp.c | 54 +++++++++++++++++++++++++++++++------------
1 file changed, 39 insertions(+), 15 deletions(-)
--
2.56.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net-next v4 1/2] net: sfp: move sfp_strlen() above the quirk fixups 2026-11-21 9:12 [PATCH net-next v4 0/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T Daniel Pawlik @ 2026-11-21 9:12 ` Daniel Pawlik 2026-11-21 9:12 ` [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik 1 sibling, 0 replies; 7+ messages in thread From: Daniel Pawlik @ 2026-11-21 9:12 UTC (permalink / raw) To: andrew, hkallweit1, linux Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms, kabel, petr.wozniak, maxime.chevallier, olek2, Daniel Pawlik sfp_strlen() is defined after the quirk table, so the fixups that the table references cannot use it. Move it above the fixups so that the next patch can match a vendor revision with the same space and NUL padding rules as the vendor name and part number matching. No functional change. Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/phy/sfp.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 915156743701..8406ad8ee786 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -482,6 +482,20 @@ static void sfp_fixup_rollball_cc(struct sfp *sfp) sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SFI; } +static size_t sfp_strlen(const char *str, size_t maxlen) +{ + size_t size, i; + + /* Trailing characters should be filled with space chars, but + * some manufacturers can't read SFF-8472 and use NUL. + */ + for (i = 0, size = 0; i < maxlen; i++) + if (str[i] != ' ' && str[i] != '\0') + size = i + 1; + + return size; +} + static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, struct sfp_module_caps *caps) { @@ -660,20 +674,6 @@ static const struct sfp_quirk sfp_quirks[] = { SFP_QUIRK_S("ZOERAX", "SFP-2.5G-T", sfp_quirk_oem_2_5g), }; -static size_t sfp_strlen(const char *str, size_t maxlen) -{ - size_t size, i; - - /* Trailing characters should be filled with space chars, but - * some manufacturers can't read SFF-8472 and use NUL. - */ - for (i = 0, size = 0; i < maxlen; i++) - if (str[i] != ' ' && str[i] != '\0') - size = i + 1; - - return size; -} - static bool sfp_match(const char *qs, const char *str, size_t len, bool prefix) { size_t qs_len; -- 2.56.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B 2026-11-21 9:12 [PATCH net-next v4 0/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T Daniel Pawlik 2026-11-21 9:12 ` [PATCH net-next v4 1/2] net: sfp: move sfp_strlen() above the quirk fixups Daniel Pawlik @ 2026-11-21 9:12 ` Daniel Pawlik 2026-11-21 18:03 ` Andrew Lunn 2026-11-24 15:09 ` Marek Behún 1 sibling, 2 replies; 7+ messages in thread From: Daniel Pawlik @ 2026-11-21 9:12 UTC (permalink / raw) To: andrew, hkallweit1, linux Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms, kabel, petr.wozniak, maxime.chevallier, olek2, Daniel Pawlik "OEM SFP-10G-T" modules with vendor revision "A" have no RollBall I2C-to-MDIO bridge: page 3 of the 0x51 EEPROM passively echoes written bytes, so every RollBall command times out. With instrumented mdio-i2c, the CMD register reads back exactly the written command byte (0x02) forever, with no DONE and no I2C errors. 0x56 reads back all 0xff, so the PHY is not reachable at all. A genuine RollBall module with the same vendor and part number (revision "02", AQR113C PHY) on the same board answers DONE on the first poll and its PHY attaches within ~2 seconds. A rev B module with an RTL8261BE PHY, reported on the OpenWrt tracker, hits the same RollBall timeouts. The bridge probe added by commit 8fe125892f40 ("net: phy: sfp: probe for RollBall I2C-to-MDIO bridge in mdio-i2c"), since reverted, found no bridge on it, after which the module worked. That module reaches this quirk entry only because its part number is "SFP-10G-T" at that point: it is a rate-adapting module which reports "SFP-10G-T" with a 2.5G or faster peer and "SFP-10G-T-I" with a 1G peer, and only the former matches this entry, which is the sole entry forcing RollBall on it. The "SFP-10G-T-I" variant matches no quirk and keeps the default behaviour either way. Because the SFP-10G-T quirk forces RollBall, the kernel retries the PHY probe 25 times at ~21 seconds per attempt, i.e. for over nine minutes, before giving up and falling back to inband mode. Each attempt runs from sfp_timeout() with rtnl_lock held, so for the whole window every rtnl user on the system stalls in ~21 second chunks, including the state machines of other SFP cages: insertion and removal of a module in another cage is only processed after the current attempt ends. In one test, a module pulled from the other cage kept being polled by phylib until the attempt ended, triggering a WARN from phy_error_precise(). Give the SFP-10G-T entry its own fixup that skips the PHY probe for revisions "A" and "B", while keeping the forced extended compliance code so that the module still links up in 10GBASE-R inband mode as before. Other revisions keep the RollBall fixup unchanged. Tested on a Banana Pi BPI-R4 with rev A and rev 02 modules: the rev A module links up at 10G ~16 s after insertion instead of over nine minutes, and the rev 02 module is unaffected. No rev B module was available for testing; its match is based on the report above.[1] [1] https://github.com/openwrt/openwrt/pull/22910 Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com> Link: https://lore.kernel.org/netdev/20260624084814.20972-1-petr.wozniak@gmail.com/ --- drivers/net/phy/sfp.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 8406ad8ee786..d2c1bbe6686a 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -496,6 +496,30 @@ static size_t sfp_strlen(const char *str, size_t maxlen) return size; } +static void sfp_fixup_oem_10gt(struct sfp *sfp) +{ + char rev = sfp->id.base.vendor_rev[0]; + + /* Revisions A and B of this module have no RollBall I2C-to-MDIO + * bridge (on rev A, page 3 of the 0x51 EEPROM just echoes written + * bytes), so every RollBall command times out and the PHY probe + * keeps retrying for over nine minutes, holding rtnl_lock for ~20 + * seconds per attempt. The PHY is not accessible at all, so use the + * module without one. + */ + if (sfp_strlen(sfp->id.base.vendor_rev, 4) == 1 && + (rev == 'A' || rev == 'B')) { + dev_dbg(sfp->dev, + "rev %c has no RollBall MDIO bridge, not probing for a PHY\n", + rev); + sfp->mdio_protocol = MDIO_I2C_NONE; + sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SFI; + return; + } + + sfp_fixup_rollball_cc(sfp); +} + static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, struct sfp_module_caps *caps) { @@ -643,7 +667,7 @@ static const struct sfp_quirk sfp_quirks[] = { // OEM SFP-GE-T is a 1000Base-T module with broken TX_FAULT indicator SFP_QUIRK_F("OEM", "SFP-GE-T", sfp_fixup_ignore_tx_fault), - SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_rollball_cc), + SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_oem_10gt), SFP_QUIRK_S("OEM", "SFP-2.5G-T", sfp_quirk_oem_2_5g), SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-D", sfp_quirk_2500basex), SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-U", sfp_quirk_2500basex), -- 2.56.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B 2026-11-21 9:12 ` [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik @ 2026-11-21 18:03 ` Andrew Lunn 2026-11-24 15:09 ` Marek Behún 1 sibling, 0 replies; 7+ messages in thread From: Andrew Lunn @ 2026-11-21 18:03 UTC (permalink / raw) To: Daniel Pawlik Cc: hkallweit1, linux, netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms, kabel, petr.wozniak, maxime.chevallier, olek2 On Sat, Nov 21, 2026 at 10:12:35AM +0100, Daniel Pawlik wrote: > "OEM SFP-10G-T" modules with vendor revision "A" have no RollBall > I2C-to-MDIO bridge: page 3 of the 0x51 EEPROM passively echoes written > bytes, so every RollBall command times out. With instrumented mdio-i2c, > the CMD register reads back exactly the written command byte (0x02) > forever, with no DONE and no I2C errors. 0x56 reads back all 0xff, so the > PHY is not reachable at all. A genuine RollBall module with the same > vendor and part number (revision "02", AQR113C PHY) on the same board > answers DONE on the first poll and its PHY attaches within ~2 seconds. > A rev B module with an RTL8261BE PHY, reported on the OpenWrt tracker, > hits the same RollBall timeouts. The bridge probe added by > commit 8fe125892f40 ("net: phy: sfp: probe for RollBall I2C-to-MDIO > bridge in mdio-i2c"), since reverted, found no bridge on it, after > which the module worked. > > That module reaches this quirk entry only because its part number is > "SFP-10G-T" at that point: it is a rate-adapting module which reports > "SFP-10G-T" with a 2.5G or faster peer and "SFP-10G-T-I" with a 1G > peer, and only the former matches this entry, which is the sole entry > forcing RollBall on it. The "SFP-10G-T-I" variant matches no quirk and > keeps the default behaviour either way. > > Because the SFP-10G-T quirk forces RollBall, the kernel retries the PHY > probe 25 times at ~21 seconds per attempt, i.e. for over nine minutes, > before giving up and falling back to inband mode. Each attempt runs from > sfp_timeout() with rtnl_lock held, so for the whole window every rtnl > user on the system stalls in ~21 second chunks, including the state > machines of other SFP cages: insertion and removal of a module in another > cage is only processed after the current attempt ends. In one test, a > module pulled from the other cage kept being polled by phylib until the > attempt ended, triggering a WARN from phy_error_precise(). > > Give the SFP-10G-T entry its own fixup that skips the PHY probe for > revisions "A" and "B", while keeping the forced extended compliance code > so that the module still links up in 10GBASE-R inband mode as before. > Other revisions keep the RollBall fixup unchanged. > > Tested on a Banana Pi BPI-R4 with rev A and rev 02 modules: the rev A > module links up at 10G ~16 s after insertion instead of over nine > minutes, and the rev 02 module is unaffected. No rev B module was > available for testing; its match is based on the report above.[1] > > [1] https://github.com/openwrt/openwrt/pull/22910 > > Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com> > Link: https://lore.kernel.org/netdev/20260624084814.20972-1-petr.wozniak@gmail.com/ Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B 2026-11-21 9:12 ` [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik 2026-11-21 18:03 ` Andrew Lunn @ 2026-11-24 15:09 ` Marek Behún 2026-11-24 17:38 ` Andrew Lunn 1 sibling, 1 reply; 7+ messages in thread From: Marek Behún @ 2026-11-24 15:09 UTC (permalink / raw) To: Daniel Pawlik Cc: andrew, hkallweit1, linux, netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms, petr.wozniak, maxime.chevallier, olek2 It would be much better to somehow check for RollBall protocol. For example by trying one mdio read before probing PHY in sfp_sm_probe_for_phy(): case MDIO_I2C_ROLLBALL: err = sfp_sm_probe_phy(sfp, SFP_PHY_ADDR_ROLLBALL, true); break; change to: case MDIO_I2C_ROLLBALL: err = mdiobus_c45_read(sfp->i2c_mii, SFP_PHY_ADDR_ROLLBALL, 1, 0); if (err == -ETIMEDOUT) { dev_info(sfp->dev, "RollBall bus not present\n"); return 0; } err = sfp_sm_probe_phy(sfp, SFP_PHY_ADDR_ROLLBALL, true); break; Marek On Sat, Nov 21, 2026 at 10:12:35AM +0100, Daniel Pawlik wrote: > "OEM SFP-10G-T" modules with vendor revision "A" have no RollBall > I2C-to-MDIO bridge: page 3 of the 0x51 EEPROM passively echoes written > bytes, so every RollBall command times out. With instrumented mdio-i2c, > the CMD register reads back exactly the written command byte (0x02) > forever, with no DONE and no I2C errors. 0x56 reads back all 0xff, so the > PHY is not reachable at all. A genuine RollBall module with the same > vendor and part number (revision "02", AQR113C PHY) on the same board > answers DONE on the first poll and its PHY attaches within ~2 seconds. > A rev B module with an RTL8261BE PHY, reported on the OpenWrt tracker, > hits the same RollBall timeouts. The bridge probe added by > commit 8fe125892f40 ("net: phy: sfp: probe for RollBall I2C-to-MDIO > bridge in mdio-i2c"), since reverted, found no bridge on it, after > which the module worked. > > That module reaches this quirk entry only because its part number is > "SFP-10G-T" at that point: it is a rate-adapting module which reports > "SFP-10G-T" with a 2.5G or faster peer and "SFP-10G-T-I" with a 1G > peer, and only the former matches this entry, which is the sole entry > forcing RollBall on it. The "SFP-10G-T-I" variant matches no quirk and > keeps the default behaviour either way. > > Because the SFP-10G-T quirk forces RollBall, the kernel retries the PHY > probe 25 times at ~21 seconds per attempt, i.e. for over nine minutes, > before giving up and falling back to inband mode. Each attempt runs from > sfp_timeout() with rtnl_lock held, so for the whole window every rtnl > user on the system stalls in ~21 second chunks, including the state > machines of other SFP cages: insertion and removal of a module in another > cage is only processed after the current attempt ends. In one test, a > module pulled from the other cage kept being polled by phylib until the > attempt ended, triggering a WARN from phy_error_precise(). > > Give the SFP-10G-T entry its own fixup that skips the PHY probe for > revisions "A" and "B", while keeping the forced extended compliance code > so that the module still links up in 10GBASE-R inband mode as before. > Other revisions keep the RollBall fixup unchanged. > > Tested on a Banana Pi BPI-R4 with rev A and rev 02 modules: the rev A > module links up at 10G ~16 s after insertion instead of over nine > minutes, and the rev 02 module is unaffected. No rev B module was > available for testing; its match is based on the report above.[1] > > [1] https://github.com/openwrt/openwrt/pull/22910 > > Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com> > Link: https://lore.kernel.org/netdev/20260624084814.20972-1-petr.wozniak@gmail.com/ > --- > drivers/net/phy/sfp.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c > index 8406ad8ee786..d2c1bbe6686a 100644 > --- a/drivers/net/phy/sfp.c > +++ b/drivers/net/phy/sfp.c > @@ -496,6 +496,30 @@ static size_t sfp_strlen(const char *str, size_t maxlen) > return size; > } > > +static void sfp_fixup_oem_10gt(struct sfp *sfp) > +{ > + char rev = sfp->id.base.vendor_rev[0]; > + > + /* Revisions A and B of this module have no RollBall I2C-to-MDIO > + * bridge (on rev A, page 3 of the 0x51 EEPROM just echoes written > + * bytes), so every RollBall command times out and the PHY probe > + * keeps retrying for over nine minutes, holding rtnl_lock for ~20 > + * seconds per attempt. The PHY is not accessible at all, so use the > + * module without one. > + */ > + if (sfp_strlen(sfp->id.base.vendor_rev, 4) == 1 && > + (rev == 'A' || rev == 'B')) { > + dev_dbg(sfp->dev, > + "rev %c has no RollBall MDIO bridge, not probing for a PHY\n", > + rev); > + sfp->mdio_protocol = MDIO_I2C_NONE; > + sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SFI; > + return; > + } > + > + sfp_fixup_rollball_cc(sfp); > +} > + > static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, > struct sfp_module_caps *caps) > { > @@ -643,7 +667,7 @@ static const struct sfp_quirk sfp_quirks[] = { > // OEM SFP-GE-T is a 1000Base-T module with broken TX_FAULT indicator > SFP_QUIRK_F("OEM", "SFP-GE-T", sfp_fixup_ignore_tx_fault), > > - SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_rollball_cc), > + SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_oem_10gt), > SFP_QUIRK_S("OEM", "SFP-2.5G-T", sfp_quirk_oem_2_5g), > SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-D", sfp_quirk_2500basex), > SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-U", sfp_quirk_2500basex), > -- > 2.56.1 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B 2026-11-24 15:09 ` Marek Behún @ 2026-11-24 17:38 ` Andrew Lunn 2026-11-24 17:56 ` Daniel Pawlik 0 siblings, 1 reply; 7+ messages in thread From: Andrew Lunn @ 2026-11-24 17:38 UTC (permalink / raw) To: Marek Behún Cc: Daniel Pawlik, hkallweit1, linux, netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms, petr.wozniak, maxime.chevallier, olek2 On Tue, Nov 24, 2026 at 04:09:21PM +0100, Marek Behún wrote: > It would be much better to somehow check for RollBall protocol. > > For example by trying one mdio read before probing PHY in > sfp_sm_probe_for_phy(): > > case MDIO_I2C_ROLLBALL: > err = sfp_sm_probe_phy(sfp, SFP_PHY_ADDR_ROLLBALL, true); > break; > > change to: > > case MDIO_I2C_ROLLBALL: > err = mdiobus_c45_read(sfp->i2c_mii, SFP_PHY_ADDR_ROLLBALL, 1, 0); nitpick: MDIO_MMD_PMAPMD, MDIO_CTRL1 Andrew ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B 2026-11-24 17:38 ` Andrew Lunn @ 2026-11-24 17:56 ` Daniel Pawlik 0 siblings, 0 replies; 7+ messages in thread From: Daniel Pawlik @ 2026-11-24 17:56 UTC (permalink / raw) To: Andrew Lunn Cc: Marek Behún, hkallweit1, linux, netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms, petr.wozniak, maxime.chevallier, olek2, szymon.datko On Tue, Nov 24, 2026, Marek Behún wrote: > It would be much better to somehow check for RollBall protocol. Agreed, that is nicer than matching revisions - it covers every bridge-less variant without a list. Two problems with the snippet as written, though: - i2c_mii_read_rollball() maps a poll timeout to 0xffff, so mdiobus_c45_read() never returns -ETIMEDOUT here. - Returning 0 skips the PHY probe retry loop, so a genuine module whose bridge is still booting at the first read would lose its PHY for good. That is what got 8fe125892f40 reverted in b521003c27eb. What about this instead (with Andrew's MDIO_MMD_PMAPMD/MDIO_CTRL1): case MDIO_I2C_ROLLBALL: /* mdio-i2c reports a RollBall command timeout as 0xffff, * both for a bridge that is still booting and for a module * without a bridge. Retry after one cheap read instead of a * full PHY probe, which times out on every register under * rtnl_lock. */ err = mdiobus_c45_read(sfp->i2c_mii, SFP_PHY_ADDR_ROLLBALL, MDIO_MMD_PMAPMD, MDIO_CTRL1); if (err == 0xffff) return -ENODEV; err = sfp_sm_probe_phy(sfp, SFP_PHY_ADDR_ROLLBALL, true); break; It ends in the same -ENODEV retry the full probe returns today, but a failed attempt costs one read (~0.3 s under rtnl_lock) instead of a full probe (~21 s). A bridge-less module then falls back after ~33 s instead of ~9 minutes, with no revision list. The trade-off: a genuine module whose bridge stays silent for more than ~33 s would lose its PHY, where today the slow probe accidentally gives it ~9 minutes. The RollBall fixup comment says modules block access for up to 25 seconds, so I think that is fine, but please shout if you know of slower ones. If you are OK with the shape, I'll test it on the rev A module and send v5 as a single patch. Dan wt., 24 lis 2026 o 18:38 Andrew Lunn <andrew@lunn.ch> napisał(a): > > On Tue, Nov 24, 2026 at 04:09:21PM +0100, Marek Behún wrote: > > It would be much better to somehow check for RollBall protocol. > > > > For example by trying one mdio read before probing PHY in > > sfp_sm_probe_for_phy(): > > > > case MDIO_I2C_ROLLBALL: > > err = sfp_sm_probe_phy(sfp, SFP_PHY_ADDR_ROLLBALL, true); > > break; > > > > change to: > > > > case MDIO_I2C_ROLLBALL: > > err = mdiobus_c45_read(sfp->i2c_mii, SFP_PHY_ADDR_ROLLBALL, 1, 0); > > nitpick: MDIO_MMD_PMAPMD, MDIO_CTRL1 > > Andrew ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-24 17:56 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-11-21 9:12 [PATCH net-next v4 0/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T Daniel Pawlik 2026-11-21 9:12 ` [PATCH net-next v4 1/2] net: sfp: move sfp_strlen() above the quirk fixups Daniel Pawlik 2026-11-21 9:12 ` [PATCH net-next v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik 2026-11-21 18:03 ` Andrew Lunn 2026-11-24 15:09 ` Marek Behún 2026-11-24 17:38 ` Andrew Lunn 2026-11-24 17:56 ` Daniel Pawlik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox