Re: [PATCH net v3 0/5] net: phy: fix cleanup after probe failure
From: Andrew Lunn
Date: Wed Aug 19 2026 - 09:33:59 EST
On Wed, Aug 19, 2026 at 02:02:31PM +0800, Xuanqiang Luo wrote:
> From: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
>
> phy_probe() initializes the PHY driver, ports, SFP upstream, and LEDs in
> stages. Its error paths do not always release only the resources acquired
> at each stage. It can also mark the PHY ready before all setup succeeds.
>
> Port setup also leaves SFP cleanup split between phy_sfp_probe(),
> phy_setup_ports(), and phy_probe(), and default port setup ignores errors
> from attaching the port to the PHY driver.
>
> This series makes each initialization layer own its cleanup and propagates
> setup failures to the caller.
>
> Patch 1 splits the phy_probe() cleanup by initialization stage.
>
> Patch 2 makes SFP and port setup unwind their resources in the required
> order.
>
> Patch 3 sets PHY_READY only after LED setup succeeds.
>
> Patch 4 calls the PHY driver remove callback after later probe failures.
>
> Patch 5 propagates errors from default port setup.
The scope of these patches has increased quite a bit. It is now more
like ongoing development work than a actual fix. Does this bother
anybody?
Please submit for net-next, once it reopens.
Andrew