Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/4] net: phy: restore driver state after userspace MII resets
@ 2026-11-13  8:48 James Hilliard
  2026-11-13  8:48 ` [PATCH net 1/4] net: b44: keep phylib ioctls outside the spinlock James Hilliard
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: James Hilliard @ 2026-11-13  8:48 UTC (permalink / raw)
  To: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Michael Chan, Hauke Mehrtens,
	Andrew Lunn
  Cc: netdev, linux-kernel, James Hilliard

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@gmail.com>
---
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@gmail.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-13  9:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  8:48 [PATCH net 0/4] net: phy: restore driver state after userspace MII resets James Hilliard
2026-11-13  8:48 ` [PATCH net 1/4] net: b44: keep phylib ioctls outside the spinlock James Hilliard
2026-11-13  8:48 ` [PATCH net 2/4] net: phy: propagate MII register write errors James Hilliard
2026-11-13  8:48 ` [PATCH net 3/4] net: phy: quiesce the state machine during MII resets James Hilliard
2026-11-13  8:48 ` [PATCH net 4/4] net: phylink: reinitialize the PHY after an MII reset James Hilliard
2026-11-13  8:53 ` [PATCH net 0/4] net: phy: restore driver state after userspace MII resets netdev-bot+sinfo
2026-11-13  9:28   ` James Hilliard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox