mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] net: phy: postpone PHY interrupts during sleep with MAC-managed PM
@ 2026-10-26  4:53 Igor Velkov
  2026-10-26  4:53 ` [PATCH net v2 1/2] net: phy: move irq_suspended and irq_rerun out of the bitfield Igor Velkov
  2026-10-26  4:53 ` [PATCH net v2 2/2] net: phy: postpone PHY interrupts during sleep with MAC-managed PM Igor Velkov
  0 siblings, 2 replies; 6+ messages in thread
From: Igor Velkov @ 2026-10-26  4:53 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Lukas Wunner, Rafael J. Wysocki, Wei Fang, Niklas Söderlund,
	Paul Barker, Florian Fainelli, Doug Berger, Thangaraj Samynathan,
	netdev, linux-kernel, Igor Velkov

When the MAC driver manages PHY PM, phylib never sets irq_suspended, and
a PHY interrupt during the sleep transition runs the PHY driver's
handler while the MDIO bus may be powered down. On Helios64 (dwmac-rk)
this hangs the board on suspend as well as on resume.

Patch 1 moves the two flags out of a bitfield they share with the link
state written under phydev->lock; patch 2 sets irq_suspended for these
PHYs too.

mac_managed_pm (fba863b81604) means the MAC driver suspends and resumes
the PHY; it does not cover the PHY interrupt. Neither phylink nor any
MAC driver touches irq_suspended, and resume_device_irqs() runs at the
end of the noirq phase, before the normal resume callbacks of the MAC,
the MDIO bus and the PHY, so callback order does not help the
interrupt. v1 asked whether phylink_suspend()/phylink_resume() would be
the better place; v2 keeps the fix in phylib, which also covers MAC
drivers that use phylib without phylink.

Changes in v2:
- new patch 1: bools instead of bitfields (Sashiko); sizeof(struct
  phy_device) is unchanged on arm64
- phy_free_interrupt(): re-enable a shared line after free_irq()
  instead of dropping irq_rerun before it (Sashiko)
- reworded the comment in mdio_bus_phy_suspend() (Andrew)
- described and tested the suspend-side window, noted the wakeup
  event; the v1 tests with Wake-on-LAN (Helios64 20/20, ODROID-HC4
  10/10) were on v1 code
- W=1 allmodconfig/allyesconfig: no new warnings

Not tested: patch 1 alone, and a vanilla net kernel on hardware; the
tests ran on an Armbian 7.3 kernel whose Helios64 DT describes the PHY
interrupt.

Link to v1: https://lore.kernel.org/r/20261002043548.1302145-1-iav@iav.lv

Igor Velkov (2):
  net: phy: move irq_suspended and irq_rerun out of the bitfield
  net: phy: postpone PHY interrupts during sleep with MAC-managed PM

 drivers/net/phy/phy.c        |  9 ++++++++
 drivers/net/phy/phy_device.c | 44 ++++++++++++++++++++++--------------
 include/linux/phy.h          |  5 ++--
 3 files changed, 39 insertions(+), 19 deletions(-)


base-commit: 7076f684d5132e6a6145e1da2fa74771ecd052e5
-- 
2.43.0


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

end of thread, other threads:[~2026-10-27 16:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26  4:53 [PATCH net v2 0/2] net: phy: postpone PHY interrupts during sleep with MAC-managed PM Igor Velkov
2026-10-26  4:53 ` [PATCH net v2 1/2] net: phy: move irq_suspended and irq_rerun out of the bitfield Igor Velkov
2026-10-26 12:54   ` Andrew Lunn
2026-10-26 17:32     ` Igor Velkov
2026-10-26  4:53 ` [PATCH net v2 2/2] net: phy: postpone PHY interrupts during sleep with MAC-managed PM Igor Velkov
2026-10-27 16:55   ` netdev-bot+sashiko

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

all inboxes | Powered by JetHome®