From: "Marek Behún" <marek.behun@nic.cz>
To: Daniel Pawlik <pawlik.dan@gmail.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>, "Marek Behún" <kabel@kernel.org>,
hkallweit1@gmail.com, linux@armlinux.org.uk,
netdev@vger.kernel.org, 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 v4 2/2] net: sfp: skip PHY probe on bridge-less OEM SFP-10G-T revisions A and B
Date: Wed, 25 Nov 2026 09:45:39 +0100 [thread overview]
Message-ID: <awaf-l4FLw0TgpOn@solitude> (raw)
In-Reply-To: <CALC2AphzUqBjgx+JqLTQU8=EizXoR+EKTJjakjKbP29exNNH0g@mail.gmail.com>
On Tue, Nov 24, 2026 at 06:56:38PM +0100, Daniel Pawlik wrote:
> 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.
Right.
> 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;
And the variable should be called `ret` instead of `err` in this case,
since it also can return a value, not just error code or zero.
Marek
prev parent reply other threads:[~2026-11-25 8:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2026-11-25 8:45 ` Marek Behún [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=awaf-l4FLw0TgpOn@solitude \
--to=marek.behun@nic.cz \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@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 \
/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