Re: [PATCH net-next v5 3/4] net: phy: serialise attach and detach with PHY driver bind and unbind

From: Andrew Lunn

Date: Mon Oct 12 2026 - 22:38:41 EST


On Fri, Oct 09, 2026 at 09:05:49PM +0300, Aleksei Sviridkin wrote:
> phy_attach_direct() reads phydev->drv and d->driver with nothing held
> against the driver core, then calls into the driver through
> phy_init_hw() and phy_resume(). An unbind that runs during an attach
> can remove the driver under it, and an attach that runs while a driver
> is still probing can call config_init before the driver's probe has
> finished.
>
> Found on a Keenetic KN-1012 (MT7981) while testing how a port copes
> with its PHY driver coming and going, on an OpenWrt 6.18 kernel.
> Unbinding the wan PHY driver through sysfs while "ip link set wan up"
> ran oopsed on the first attempt, with nothing added to widen the
> window, inside the driver's own calibration code:

Given the complexity, i'm don't think it is worth fixing. Unbinding
modules is not a normal use case, it is more of a hackers tool to
speed up development. So i can life with crashes like this.

Andrew