From: Igor Velkov <iav@iav.lv>
To: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: "Lukas Wunner" <lukas@wunner.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
"Wei Fang" <wei.fang@nxp.com>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Paul Barker" <paul@pbarker.dev>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Doug Berger" <opendmb@gmail.com>,
"Thangaraj Samynathan" <Thangaraj.S@microchip.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Igor Velkov" <iav@iav.lv>
Subject: [PATCH net v2 0/2] net: phy: postpone PHY interrupts during sleep with MAC-managed PM
Date: Mon, 26 Oct 2026 06:53:41 +0200 [thread overview]
Message-ID: <20261026045343.837889-1-iav@iav.lv> (raw)
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
next reply other threads:[~2026-10-26 4:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 4:53 Igor Velkov [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261026045343.837889-1-iav@iav.lv \
--to=iav@iav.lv \
--cc=Thangaraj.S@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lukas@wunner.de \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=paul@pbarker.dev \
--cc=rafael.j.wysocki@intel.com \
--cc=wei.fang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox