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

From: Andrew Lunn
Date: Sat Jun 21 2025 - 04:02:08 EST


> +/**
> + * phy_disconnect_rtnl - disable interrupts, stop state machine, and detach a PHY
> + * device
> + * @phydev: target phy_device struct
> + *
> + * This is a wrapper around phy_disconnect that takes the rtnl semaphore.
> + */

Developers are likely to get this wrong, because generally they don't
need to bother with RTNL, the core does it. Could you add some
guidance here when this should be used, and when not.

Andrew