From: Kory Maincent <kory.maincent@bootlin.com>
To: Corey Leavitt <corey@leavitt.info>
Cc: Carlo Szelinsky <github@szelinsky.de>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Andrew Lunn <andrew+netdev@lunn.ch>, Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC net-next 0/4] net: pse-pd: decouple controller lookup from MDIO probe
Date: Fri, 24 Apr 2026 14:41:24 +0200 [thread overview]
Message-ID: <20260424144124.131837c7@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <177693772506.254295.6378636892307427408@leavitt.info>
On Thu, 23 Apr 2026 09:48:53 +0000
Corey Leavitt <corey@leavitt.info> wrote:
> Hi Kory,
>
> Thanks for the pointer -- I had not seen Carlo's thread; I should have
> searched lore before sending and will do so before v2. Adding Carlo on
> cc.
>
> Having read it end-to-end, my read of the state as of 2026-04-13 was
> that the conversation had narrowed to two open directions: propagate
> EPROBE_DEFER further up into phylink/MAC probe (Andrew/Russell), or
> resolve psec at PSE controller register time (your msg on 9 Apr,
> "save the phandle ... then at PSE register time look for each PHY and
> try to resolve every unresolved phandle"). Nothing concrete had been
> posted for either.
>
> This RFC implements the second direction. pse_core publishes a
> BLOCKING_NOTIFIER chain with REGISTERED / UNREGISTERED events,
> phy_device subscribes, and psec ownership moves from fwnode_mdio probe
> into the notifier handler. Concretely with respect to points raised in
> the earlier thread:
>
> - fwnode_mdio loses PSE awareness entirely, so the MDIO bus scan no
> longer sees -EPROBE_DEFER from PSE lookup. Consistent with
> Andrew's point that bus and device lifecycles are separate.
>
> - psec is acquired at PSE register time, before
> regulator_late_cleanup (30s) can run. Carlo's admin_state_synced
> guard (his patch 1) therefore isn't needed in this model. psec
> resolution happens eagerly on the REGISTERED event rather than
> lazily on first ethtool access, so his patch 2 is also not needed.
> And because fwnode_mdio no longer looks up PSE at all, the
> non-fatal EPROBE_DEFER handling there (patch 3) drops out. This
> series is a different architectural shape, not an increment on
> his v2.
>
> - Oleksij's concern about lazy resolution dropping UAPI
> notifications is addressed: the notifier fires at register time,
> so boot-time observer semantics are preserved.
>
> - One caveat I already owe a fix for in v2: the attach helper in
> phy_device currently treats every error from of_pse_control_get()
> as retry-on-notifier, including non-transient ones. Carlo's v2
> patch 3 was careful to differentiate -EPROBE_DEFER from bad-DT
> errors at the fwnode_mdio lookup site (which matches his msg 1
> concern about catching broken bindings at boot rather than
> silently later). I need to preserve that discrimination at the
> notifier-handler site -- phydev_warn() on anything other than
> -EPROBE_DEFER. Trivial, but worth flagging.
>
> - The DSA genphy force-bind sequence Carlo hit
> (phy_attach_direct -> device_bind_driver -> deferred retry
> skipped) does not apply, because psec attachment is not tied to
> phy_probe.
>
> - Patch 1 of this series scopes the regulator handle held by
> pse_control to its own kref lifetime, fixing a latent
> dangling-handle sequence that the notifier unregister path makes
> reachable. This is a separate regulator-lifetime bug from the one
> Carlo's patch 1 addresses.
This seems to provide a solution to all our problems, and it is well designed.
Carlo, it would be nice if you could test it on your side.
> Validated end-to-end on a Cudy C200P (MT7621 DSA + i2c IP804AR as
> module), with lockdep active, across the i2c driver unbind/rebind
> cycle that triggers UNREGISTERED -> REGISTERED on the live system.
> The cover letter has the full evidence.
>
> I would welcome your view on whether this is the shape you had in
> mind on 9 Apr, or whether the MDI-based binding you raised with
> Maxime is the better endpoint and we should be reshaping around that.
> Happy to keep this RFC as the scaffolding either way.
After a second thought, MDI-based binding is currently not in the pipe and we
should solve this without it for now.
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-04-24 12:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 7:42 [PATCH RFC net-next 0/4] net: pse-pd: decouple controller lookup from MDIO probe Corey Leavitt via B4 Relay
2026-04-23 7:42 ` [PATCH RFC net-next 1/4] net: pse-pd: scope pse_control regulator handle to kref lifetime Corey Leavitt via B4 Relay
2026-04-24 8:36 ` Kory Maincent
2026-04-23 7:42 ` [PATCH RFC net-next 2/4] net: pse-pd: add notifier chain for controller lifecycle events Corey Leavitt via B4 Relay
2026-04-23 7:42 ` [PATCH RFC net-next 3/4] net: pse-pd: fire lifecycle events on controller register/unregister Corey Leavitt via B4 Relay
2026-04-23 7:42 ` [PATCH RFC net-next 4/4] net: phy: own phydev->psec via PSE notifier and remove fwnode_mdio hook Corey Leavitt via B4 Relay
2026-04-24 12:36 ` Kory Maincent
2026-04-23 9:05 ` [PATCH RFC net-next 0/4] net: pse-pd: decouple controller lookup from MDIO probe Kory Maincent
2026-04-23 9:48 ` Corey Leavitt
2026-04-24 12:41 ` Kory Maincent [this message]
2026-04-26 21:25 ` Carlo Szelinsky
2026-05-02 20:10 ` Carlo Szelinsky
-- strict thread matches above, loose matches on Subject: below --
2026-04-25 6:33 Corey Leavitt
2026-04-23 7:22 Corey Leavitt
2026-04-23 8:40 ` Corey Leavitt
2026-04-23 12:08 ` Jonas Gorski
2026-04-24 1:28 ` Corey Leavitt
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=20260424144124.131837c7@kmaincent-XPS-13-7390 \
--to=kory.maincent@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=corey@leavitt.info \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=github@szelinsky.de \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.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