Re: [PATCH 3/3] net: pse-pd: add lazy PSE control resolution for modular drivers

Kory Maincent
2026-03-30T11:23:41Z

On Sun, 29 Mar 2026 18:10:14 +0200
Carlo Szelinsky <github@szelinsky.de> 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@bootlin.com>

Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering