|
|
Log in / Subscribe / Register

net: pse-pd: support module-based PSE controller drivers

From:  Carlo Szelinsky <github-AT-szelinsky.de>
To:  Kory Maincent <kory.maincent-AT-bootlin.com>, Oleksij Rempel <o.rempel-AT-pengutronix.de>, Andrew Lunn <andrew+netdev-AT-lunn.ch>
Subject:  [PATCH 0/3] net: pse-pd: support module-based PSE controller drivers
Date:  Sun, 29 Mar 2026 18:10:11 +0200
Message-ID:  <20260329161014.2908509-1-github@szelinsky.de>
Cc:  Heiner Kallweit <hkallweit1-AT-gmail.com>, Russell King <linux-AT-armlinux.org.uk>, Jakub Kicinski <kuba-AT-kernel.org>, "David S . Miller" <davem-AT-davemloft.net>, Eric Dumazet <edumazet-AT-google.com>, Paolo Abeni <pabeni-AT-redhat.com>, Simon Horman <horms-AT-kernel.org>, netdev-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Carlo Szelinsky <github-AT-szelinsky.de>
Archive-link:  Article

When a PSE controller driver is built as a module, it may not be probed
yet when PHYs are registered on the MDIO bus. This causes
of_pse_control_get() to return -EPROBE_DEFER, destroying the PHY device.
Later, regulator_late_cleanup disables the unclaimed PSE regulators,
permanently killing PoE.

This series fixes the issue in three steps:

  1. Treat -EPROBE_DEFER as non-fatal during PHY registration, allowing
     the PHY to register with psec=NULL.

  2. Add an admin_state_synced flag to pse_pi so that pse_pi_is_enabled()
     reports unclaimed PIs as disabled, preventing regulator_late_cleanup
     from shutting them down. The existing dual-path behavior (software-
     tracked vs. hardware-queried state) is preserved for claimed PIs.

  3. Add pse_control_try_resolve() for lazy PSE control resolution on
     first ethtool access, serialized by RTNL.

This is tested on my setup, but I am not fully sure if this is the right
approach to solve this problem. I would love to get feedback from the
maintainers on whether the overall design direction makes sense, or if
there is a better way to handle the deferred PSE control acquisition.

Carlo Szelinsky (3):
  net: mdio: treat PSE EPROBE_DEFER as non-fatal during PHY registration
  net: pse-pd: prevent regulator cleanup from disabling unclaimed PSE
    PIs
  net: pse-pd: add lazy PSE control resolution for modular drivers

 drivers/net/mdio/fwnode_mdio.c |  8 ++++--
 drivers/net/pse-pd/pse_core.c  | 49 ++++++++++++++++++++++++++++++++++
 include/linux/pse-pd/pse.h     |  6 +++++
 net/ethtool/pse-pd.c           |  4 +++
 4 files changed, 65 insertions(+), 2 deletions(-)

--
2.43.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds