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

From: Florian Fainelli
Date: Fri Jun 20 2025 - 12:26:25 EST


On 6/20/25 07:56, Russell King (Oracle) wrote:
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.


Yes, I completely agree, this should also make for a smaller patch set to review.
--
Florian