Re: [PATCH net 0/4] net: phy: restore driver state after userspace MII resets

From: Andrew Lunn

Date: Fri Nov 13 2026 - 13:43:27 EST


On Fri, Nov 13, 2026 at 09:39:17AM -0700, James Hilliard wrote:
> On Fri, Nov 13, 2026 at 6:33 AM Andrew Lunn <andrew@xxxxxxx> wrote:
> >
> > On Fri, Nov 13, 2026 at 01:48:39AM -0700, James Hilliard wrote:
> > > An MII ioctl reset needs to restore the PHY driver's configuration and
> > > software state before the PHY worker can access the device again.
> >
> > The MII ioctl is a footgun. If you use it for writing registers, don't
> > be surprised if bad things happen. Even reading registers can cause
> > bad side effects, like missed interrupts.
> >
> > The whole design is broken, there is no fixing it, so we don't try to
> > fix it.
>
> Would it make sense to submit patches 1 and 2 as standalone fixes,
> separate from the reset recovery changes?

Ask the b44 Maintainers. It is unusual for MDIO to be none blocking,
so i do wounder about the other path.

> The b44 patch removes a spinlock held across sleeping phylib/MDIO
> operations, including ordinary register reads. The write-error patch
> propagates MDIO failures and avoids updating cached settings or running
> follow-up operations after a failed write.

We don't care about the cached settings. If you have used this API,
you must expect bad things to happen. It says so in the comment above.

Andrew