Re: [PATCH 3/3] net: pse-pd: add lazy PSE control resolution for modular drivers
From: Kory Maincent
Date: Mon Mar 30 2026 - 07:29:36 EST
On Sun, 29 Mar 2026 18:10:14 +0200
Carlo Szelinsky <github@xxxxxxxxxxxx> wrote:
> When a PSE controller driver is built as a module and was not probed
> during PHY registration, the PHY ends up with psec=NULL. Add
> pse_control_try_resolve() to lazily resolve the PSE control on first
> ethtool access.
>
> Call pse_control_try_resolve() in both the GET and SET ethtool PSE
> handlers, before checking phydev->psec. The function is serialized by
> RTNL (enforced via ASSERT_RTNL), preventing concurrent callers from
> double-allocating a PSE control.
>
> If resolution fails (e.g. the module still has not loaded), a debug
> message is emitted via phydev_dbg() and the handler falls through to
> the existing "No PSE is attached" error path.
Acked-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com