Re: [PATCH net-next RFC] net: Throw ASSERT_RTNL into phy_detach

From: Russell King (Oracle)
Date: Fri Jun 20 2025 - 10:56:59 EST


On Fri, Jun 20, 2025 at 04:33:27PM +0200, Kory Maincent wrote:
> phy_detach needs the rtnl lock to be held. It should have been added before
> to avoid this massive change among lots of net drivers but there was no
> clear evidence of such needs at that time. This imply a lock change in
> this API. Add phy_detach_rtnl, phy_diconnect_rtnl, phylink_connect_phy_rtnl
> and phylink_fwnode_phy_connect_rtnl helpers to take the lock before calling
> their respective function.

Please don't increase the number of API functions for phylink for the
long term. I'd prefer all callers of the phylink phy_connect functions
be updated to hold the RTNL, just like phylink_disconnect() requires.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!