Re: [PATCH net v5] net: phy: marvell: keep WOL_EIE across interrupt reconfiguration
From: Andrew Lunn
Date: Wed Oct 14 2026 - 12:17:29 EST
On Tue, Oct 13, 2026 at 05:25:34PM -0700, Rosen Penev wrote:
> marvell_config_intr() rewrites the whole interrupt enable register, so
> the config_intr call from phy_init_hw() on resume silently cleared
> WOL_EIE on the 88E1318S and 88E1510: m88e1318_get_wol() still reported
> WAKE_MAGIC, but a matched magic packet was no longer routed to INTn and
> the board did not wake.
>
> Bit 7 of that register is WOL_EIE only on these two PHYs; on others,
> such as the 88E1111, it enables a FIFO error interrupt. So give the
> 88E1318S and 88E1510 their own config_intr and handle_interrupt, and
> leave the shared callbacks unchanged.
>
> m88e1318_set_wol() now records whether WoL is enabled, and both it and
> the new config_intr derive WOL_EIE from that state under the MDIO bus
> lock. WOL_EIE stays set across config_intr while WoL is enabled, except
> when the PHY has an interrupt line and interrupts are being disabled,
> as in phy_free_interrupt(): INTn is then the PHY IRQ, and nothing would
> read IEVENT after free_irq() to release it. The bit is set again once
> interrupts are re-enabled. phy_probe() still clears a WOL_EIE left by a
> previous boot, since WoL starts out disabled. The new handler also
> claims WoL events, so they do not go unacknowledged when the PHY IRQ is
> in use.
>
> Helios4 (Armada 388, 88E1512), 7.2.9. With this patch WOL_EIE stays set
> over 3 link down/up cycles, "wol d" clears it, and a magic packet on a
> running board is a handled interrupt. Without it, WOL_EIE is lost on the
> first down/up, survives "wol d", and the magic packet is an unhandled
> interrupt.
>
> Fixes: 3871c3876f80 ("mv643xx_eth with 88E1318S: support Wake on LAN")
> Assisted-by: LLM
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> Tested-by: Igor Velkov <iav@xxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew