Re: [PATCH net] net: phy: postpone PHY interrupts during sleep with MAC-managed PM

From: Andrew Lunn

Date: Sun Oct 04 2026 - 10:29:12 EST


On Fri, Oct 02, 2026 at 07:35:48AM +0300, Igor Velkov wrote:
> mdio_bus_phy_suspend() and mdio_bus_phy_resume() return early when the
> MAC driver manages PHY PM

One obvious question. What exactly does it mean when the MAC driver
manages PHY PM. Maybe calling irq_suspend is part of that management?

> interrupt that wakes the system fires as soon as resume_device_irqs()
> re-enables the line, before the MAC driver resumes, and phy_interrupt()
> runs the PHY driver's handler at once. If the MDIO bus was powered down
> in suspend, the MDIO access in that handler stalls the CPU.

Ignoring MAC managed for a minute....

As far as i understand, suspend goes from leaf to root. Resume goes
from root to leaf. With WoL, we leave the PHY unsuspended, and the IRQ
controller as well. But the MDIO bus driver should get suspended and
then the MAC driver. On resume, the MAC driver is resumed, then the
MDIO bus driver, and then the PHY. At this point, during resume we can
handle the interrupt. It can then do MDIO transfers, since everything
towards the root should be up and running.

What exactly is going wrong with the ordering in your case?

Andrew