[PATCH net v2 0/3] net: phy: some cleanups following phy_port SFP

From: Maxime Chevallier

Date: Mon Jun 01 2026 - 04:42:23 EST


While posting the v11 of phy_port netlink, sashiko found some
pre-existing issues, and following the tentative fix [1], Nicolai found
some more :)

Patch 1 and 2 add some cleanup in the phy_probe error paths, to discard
all SFP and phy_port that have been set-up when probing fails further
down the road.

Patch 3 fixes a sashiko-reported issue that I was able to reproduce,
where we hit a deadlock when trying to setup PHY-driven SFP ports while
using genphy. This is because the sfp init logic for PHYs is now
generic, instead of per-driver, and genphy has the particularity of
running its .probe() under RTNL, which clashes with the SFP code.

One more reason to try and cleanup RTNL handling in PHY/SFP :)

Thanks Nicolai for the feedback on V1,

Maxime

[1] : https://lore.kernel.org/r/20260530072706.3167745-1-maxime.chevallier@xxxxxxxxxxx

Maxime Chevallier (3):
net: phy: clean the sfp upstream if phy probing fails
net: phy: remove phy ports upon probe failure
net: phy: don't try to setup PHY-driven SFP cages when using genphy

drivers/net/phy/phy_device.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)

--
2.54.0