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

From: James Hilliard

Date: Fri Nov 13 2026 - 04:14:20 EST


An MII ioctl reset needs to restore the PHY driver's configuration and
software state before the PHY worker can access the device again.

This was observed while testing AC200 receive statistics: a userspace
BMCR reset cleared the hardware counters, and the next update interpreted
the decrease as counter wraparound.

First remove b44's spinlock around the sleeping phylib ioctl. Make phylib
propagate failed writes, wait for reset completion and keep the PHY worker
disabled until driver reinitialization finishes. Then use this path for
phylink BMCR reset requests targeting the attached Clause 22 PHY.

Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
James Hilliard (4):
net: b44: keep phylib ioctls outside the spinlock
net: phy: propagate MII register write errors
net: phy: quiesce the state machine during MII resets
net: phylink: reinitialize the PHY after an MII reset

drivers/net/ethernet/broadcom/b44.c | 4 ++--
drivers/net/phy/phy.c | 42 +++++++++++++++++++++++++++++++------
drivers/net/phy/phy_device.c | 2 +-
drivers/net/phy/phylib-internal.h | 1 +
drivers/net/phy/phylink.c | 14 +++++++++----
5 files changed, 50 insertions(+), 13 deletions(-)
---
base-commit: ead6fa9a0ab194f02a2f36d634b193e9c5f9a1c6
change-id: 20261113-submit-phy-mii-reset-v1-1b9ec0e2be11

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>