Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Daniel Pawlik <pawlik.dan@gmail.com>
Cc: kabel@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk,
	netdev@vger.kernel.org, willemb@google.com,
	andrew+netdev@lunn.ch, 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, szymon.datko@gmail.com
Subject: Re: [PATCH net-next v6] net: sfp: probe RollBall bridge with one MDIO read before the PHY probe
Date: Fri, 4 Dec 2026 14:39:54 +0100	[thread overview]
Message-ID: <df8aa5d2-055b-4fb7-a525-7579cc210a7f@lunn.ch> (raw)
In-Reply-To: <20261204093408.1391147-1-pawlik.dan@gmail.com>

On Fri, Dec 04, 2026 at 10:34:08AM +0100, Daniel Pawlik wrote:
> Modules without a RollBall I2C-to-MDIO bridge time out on every RollBall
> command, but the quirks for such modules force MDIO_I2C_ROLLBALL. The
> PHY probe then retries 25 times at ~21 seconds per attempt, i.e. for
> over nine minutes, before the module links up without a PHY. 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: in one test, pulling a
> module from another cage was only processed after the current attempt
> ended, triggering a WARN from phy_error_precise().
> 
> mdio-i2c reports a RollBall command timeout as 0xffff, both for a
> bridge that is still booting and for a module without a bridge. Do one
> cheap MDIO read of the PHY ID before the full PHY probe and return
> -ENODEV on 0xffff: the existing 25 x 1 s retry loop still protects
> slow-booting genuine bridges, but a failed attempt costs one read
> instead of a full probe timing out on every register.
> 
> The ID register is used because phylib ignores a C45 MMD whose ID reads
> all-ones when matching drivers, so a PHY failing this check could not
> bind a driver through that MMD anyway. This relies on the PMA/PMD
> identifier, which Clause 45 makes mandatory, being readable once the
> bridge is up, as it is on the RollBall PHYs seen so far, such as the
> AQR113C and RTL8221B.
> 
> The trade-off is a shorter window for a bridge that stays completely
> silent: the retry loop now gives up after about 45 seconds instead of
> the ~9 minutes the slow probe accidentally provided. The RollBall
> fixup allows modules to block PHY access for up to 25 seconds after
> insertion, so this should be sufficient.
> 
> Tested on a Banana Pi BPI-R4 with a bridge-less "OEM SFP-10G-T" rev A
> module and a genuine rev 02 module with an AQR113C: the rev A module
> links up at 10G 57 s after boot instead of over nine minutes, and the
> rev 02 module attaches its PHY as before.
> 
> Suggested-by: Marek Behún <kabel@kernel.org>
> 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

      reply	other threads:[~2026-12-04 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:34 [PATCH net-next v6] net: sfp: probe RollBall bridge with one MDIO read before the PHY probe Daniel Pawlik
2026-12-04 13:39 ` Andrew Lunn [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=df8aa5d2-055b-4fb7-a525-7579cc210a7f@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kabel@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 \
    --cc=szymon.datko@gmail.com \
    --cc=willemb@google.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