linux/drivers/net/phy
Sean Anderson f0f2b992d8 net: phy: Don't register LEDs for genphy
If a PHY has no driver, the genphy driver is probed/removed directly in
phy_attach/detach. If the PHY's ofnode has an "leds" subnode, then the
LEDs will be (un)registered when probing/removing the genphy driver.
This could occur if the leds are for a non-generic driver that isn't
loaded for whatever reason. Synchronously removing the PHY device in
phy_detach leads to the following deadlock:

rtnl_lock()
ndo_close()
    ...
    phy_detach()
        phy_remove()
            phy_leds_unregister()
                led_classdev_unregister()
                    led_trigger_set()
                        netdev_trigger_deactivate()
                            unregister_netdevice_notifier()
                                rtnl_lock()

There is a corresponding deadlock on the open/register side of things
(and that one is reported by lockdep), but it requires a race while this
one is deterministic.

Generic PHYs do not support LEDs anyway, so don't bother registering
them.

Fixes: 01e5b728e9 ("net: phy: Add a binding for PHY LEDs")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://patch.msgid.link/20250707195803.666097-1-sean.anderson@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-14 17:53:09 -07:00
..
aquantia
mediatek
mscc
qcom
realtek
Kconfig
Makefile
adin.c
adin1100.c
air_en8811h.c
amd.c
as21xxx.c
ax88796b.c
ax88796b_rust.rs
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
bcm-phy-ptp.c
bcm7xxx.c
bcm63xx.c
bcm87xx.c
bcm54140.c
bcm84881.c
broadcom.c
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83td510.c
dp83tg720.c
dp83640.c
dp83640_reg.h
dp83822.c
dp83848.c
dp83867.c
dp83869.c
et1011c.c
fixed_phy.c
icplus.c
intel-xway.c
linkmode.c
lxt.c
marvell-88q2xxx.c
marvell-88x2222.c
marvell.c
marvell10g.c
mdio-boardinfo.c
mdio-boardinfo.h
mdio-open-alliance.h
mdio_bus.c
mdio_bus_provider.c
mdio_device.c
mdio_devres.c
meson-gxl.c
micrel.c
microchip.c net: phy: microchip: limit 100M workaround to link-down events on LAN88xx 2025-07-10 18:08:16 -07:00
microchip_rds_ptp.c
microchip_rds_ptp.h
microchip_t1.c
microchip_t1s.c
mii_timestamper.c
motorcomm.c
mxl-86110.c
mxl-gpy.c
national.c
ncn26000.c
nxp-c45-tja11xx-macsec.c
nxp-c45-tja11xx.c
nxp-c45-tja11xx.h
nxp-cbtx.c
nxp-tja11xx.c
open_alliance_helpers.c
open_alliance_helpers.h
phy-c45.c
phy-caps.h
phy-core.c
phy.c
phy_caps.c
phy_device.c net: phy: Don't register LEDs for genphy 2025-07-14 17:53:09 -07:00
phy_led_triggers.c
phy_link_topology.c
phy_package.c
phylib-internal.h
phylib.h
phylink.c
qsemi.c
qt2025.rs
rockchip.c
sfp-bus.c
sfp.c
sfp.h
smsc.c net: phy: smsc: Fix link failure in forced mode with Auto-MDIX 2025-07-08 18:12:49 -07:00
spi_ks8995.c
ste10Xp.c
stubs.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c