Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: pawlik.dan@gmail.com
Cc: linux@armlinux.org.uk, netdev@vger.kernel.org,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, petr.wozniak@gmail.com,
	maxime.chevallier@bootlin.com, olek2@wp.pl
Subject: Re: [PATCH net-next] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B
Date: Wed, 18 Nov 2026 12:37:05 +0000	[thread overview]
Message-ID: <179500542517.3136.17245388104642383487@kernel.org> (raw)
In-Reply-To: <20261116093605.294365-1-pawlik.dan@gmail.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The new rev "B" branch in sfp_fixup_oem_10gt()
  (drivers/net/phy/sfp.c:494-495) is justified by an RTL8261BE module,…
- [Low] The revision check in sfp_fixup_oem_10gt()
  (drivers/net/phy/sfp.c:494-495) uses a raw 4-byte memcmp() against the…
- [Low] The patch fixes a user-visible problem: link-up takes over nine
  minutes, rtnl_lock is held for ~21 s per attempt and stalls other SFP…

--

net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B

This patch gives the "OEM"/"SFP-10G-T" quirk entry its own fixup,
sfp_fixup_oem_10gt(). For vendor revisions "A" and "B" it sets
MDIO_I2C_NONE and still forces the 10GBASE-T SFI extended compliance
code; other revisions keep using sfp_fixup_rollball_cc(). This avoids a
RollBall PHY probe retry loop that runs for several minutes under
rtnl_lock on modules that have no I2C-to-MDIO bridge.

Link: https://lore.kernel.org/netdev/20260624084814.20972-1-petr.wozniak@gmail.com/

> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
> index 915156743701b..066f11241afcc 100644
> --- a/drivers/net/phy/sfp.c
> +++ b/drivers/net/phy/sfp.c
> @@ -482,6 +482,28 @@ static void sfp_fixup_rollball_cc(struct sfp *sfp)
>  	sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SFI;
>  }
>  
> +static void sfp_fixup_oem_10gt(struct sfp *sfp)
> +{

[ ... ]

> +	if (!memcmp(sfp->id.base.vendor_rev, "A   ", 4) ||
> +	    !memcmp(sfp->id.base.vendor_rev, "B   ", 4)) {

[Severity: Low]

Should this revision check accept NUL padding, the way the quirk lookup
does?

sfp_lookup_quirk() trims vendor_name and vendor_pn with sfp_strlen(),
which treats both ' ' and '\0' as trailing padding:

drivers/net/phy/sfp.c:sfp_strlen() {
    ...
	/* Trailing characters should be filled with space chars, but
	 * some manufacturers can't read SFF-8472 and use NUL.
	 */
    ...
}

Take an "OEM"/"SFP-10G-T" module with vendor_rev "A\0\0\0" or
"B\0\0\0". It would match the quirk entry, fail both memcmp() checks
here, and fall through to sfp_fixup_rollball_cc(). That brings back the
RollBall retry loop under rtnl_lock that this patch is meant to avoid.

One option is to check that sfp_strlen(sfp->id.base.vendor_rev, 4)
returns 1 and then test vendor_rev[0]. That would use the same padding
rule as the rest of the file.

[Severity: Medium]

Can the rev "B" match reach the module it is meant for?

The commit message bases it on an RTL8261BE module from the OpenWrt
report. Commit 8fe125892f40 ("net: phy: sfp: probe for RollBall
I2C-to-MDIO bridge in mdio-i2c") describes the same RTL8261BE module
like this:

    Its EEPROM reports vendor="OEM", part="SFP-10G-T-I", and -- critically --
    Vendor OUI 00:00:00 ...

That commit also added a separate SFP_QUIRK_F("OEM", "SFP-10G-T-I",
sfp_fixup_rollball) entry so the module would enter the probe path.
Revert b521003c27eb removed that entry again.

The SFP_QUIRK_F() entry here is matched by sfp_match() with
prefix=false, so the length has to match exactly:

drivers/net/phy/sfp.c:sfp_match() {
    ...
	if (prefix ? qs_len > len : qs_len != len)
		return false;
    ...
}

So "SFP-10G-T" never matches a PN of "SFP-10G-T-I". Such a module never
reaches sfp_fixup_oem_10gt(). In the current tree it matches no quirk at
all, so RollBall is not forced on it.

That means the rev B branch only affects modules whose PN is exactly
"SFP-10G-T" and whose vendor_rev is "B   ". The commit message says no
rev B module was tested. The rev 02 (AQR113C) module shows that bridged
versions of this PN do exist. If a bridged rev B "SFP-10G-T" exists, it
would now get MDIO_I2C_NONE and lose its PHY. Today it works with the
PHY attached.

Is there an EEPROM dump showing vendor_pn "SFP-10G-T" and vendor_rev "B"
for the bridge-less RTL8261BE unit? If not, would it be safer to drop
the rev B match?

> +		dev_info(sfp->dev,
> +			 "rev %c has no RollBall MDIO bridge, not probing for a PHY\n",
> +			 sfp->id.base.vendor_rev[0]);
> +		sfp->mdio_protocol = MDIO_I2C_NONE;
> +		sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SFI;
> +		return;
> +	}
> +
> +	sfp_fixup_rollball_cc(sfp);
> +}

[ ... ]

> @@ -629,7 +651,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),

[Severity: Low]

This isn't a bug, but should this patch have a Fixes: tag?

The entry that always forces RollBall here came from commit
324e88cbe3b7 ("net: sfp: add support for multigig RollBall
transceivers"). The commit message describes problems users can see:
over nine minutes to link up, rtnl_lock stalls that hold up other SFP
cages, and a WARN from phy_error_precise(). There is no Fixes: tag or
stable note to mark this for backporting.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116093605.294365-1-pawlik.dan%40gmail.com

      reply	other threads:[~2026-11-18 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  9:36 [PATCH net-next] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B Daniel Pawlik
2026-11-18 12:37 ` netdev-bot+sashiko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179500542517.3136.17245388104642383487@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olek2@wp.pl \
    --cc=pabeni@redhat.com \
    --cc=pawlik.dan@gmail.com \
    --cc=petr.wozniak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox