[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGzduaQp3hWA5V-i@shell.armlinux.org.uk>
Date: Tue, 8 Jul 2025 09:58:33 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
linux-kernel@...r.kernel.org,
"David S . Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Christian Marangi <ansuelsmth@...il.com>
Subject: Re: [PATCH net] net: phy: Don't register LEDs for genphy
On Mon, Jul 07, 2025 at 03:58:03PM -0400, Sean Anderson wrote:
> 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.
Maybe checking whether the PHY driver supports LEDs would be more
sensible than checking whether it's one of the genphy drivers?
> 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.
Doesn't this deadlock exist irrespective of whether the genphy driver(s)
are being used, and whether or not the PHY driver supports LEDs?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists