Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Willie Wiholm via B4 Relay
Fri, 27 Nov 2026 18:44
[PATCH RFC net 0/2] net: phy: dp83867: fix Wake-on-LAN without a PHY IRQ
Author: Willie Wiholm via B4 Relay
Date: Fri, 27 Nov 2026 18:44
Date: Fri, 27 Nov 2026 18:44
44 lines
12105 bytes
12105 bytes
On an Intel Elkhart Lake board (congatec conga-SA7, dwmac-intel with a
DP83867 over RGMII) Wake-on-LAN from S3 does not work on the first
suspend after boot or after a link down/up.
Patch 1 sets CFG3.INT_OE when WoL is enabled. Without a PHY IRQ the
driver never sets it, so the pin stays a power-down input. The firmware
sets it, but the soft reset on attach clears it, so the first suspend
after boot does not wake up.
Patch 2 reads ISR before suspend. Nothing reads it when the PHY is
polled, so a magic packet received while the system is running leaves
the WoL interrupt latched, and the next suspend does not wake up.
Tested on the board with net (28a371228d4e): the first suspend after
boot, after link down/up and after a magic packet received while
running all wake up on a unicast magic packet.
Questions:
1. Patch 1 makes the pin an output when WoL is enabled. Would you
rather preserve the firmware setting across the soft reset, as
043777e94880 does for the LED registers?
2. Patch 2 uses PHY_ALWAYS_CALL_SUSPEND to get a hook before suspend,
like bcm54xx. Is that acceptable?
I used an AI coding assistant (Claude) for parts of the analysis, the
test automation and for drafting the cover letter. I have
reviewed the changes and tested them on the hardware.
Signed-off-by: Willie Wiholm <willie.wiholm@tritechsolutions.se>
---
Willie Wiholm (2):
net: phy: dp83867: set INT_OE when enabling Wake-on-LAN
net: phy: dp83867: clear latched WoL interrupt before suspend
drivers/net/phy/dp83867.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
base-commit: 28a371228d4eb4857cc31eeb1a0d7d01e9c3ea2f
change-id: 20261127-wol-net-10fed393954a
Best regards,
--
Willie Wiholm <willie.wiholm@tritechsolutions.se>
[PATCH RFC net 2/2] net: phy: dp83867: clear latched WoL interrupt before suspend
Author: Willie Wiholm via B4 Relay
Date: Fri, 27 Nov 2026 18:44
Date: Fri, 27 Nov 2026 18:44
64 lines
12612 bytes
12612 bytes
From: Willie Wiholm <willie.wiholm@tritechsolutions.se>
WOL_INT in ISR is latched until ISR is read. When the PHY has no IRQ,
nothing reads ISR, so a magic packet received while the system is
running leaves the WoL interrupt pending and INT/PWDN_N asserted. The
next suspend then does not wake up on a magic packet, as the pin is
already active.
With WoL enabled, phy_suspend() does not call the driver's suspend
callback, so the driver has no chance to clear the interrupt. Set
PHY_ALWAYS_CALL_SUSPEND and, when WoL is enabled, only read ISR in
dp83867_suspend(). ISR is only read when the PHY has no IRQ, so that
pending interrupts are not lost when it has one. Without WoL the
behaviour is unchanged.
bcm54xx_suspend() acknowledges the WoL interrupt before suspend in the
same way.
Fixes: caabee5b53f5 ("net: phy: dp83867: support Wake on LAN")
Cc: stable@vger.kernel.org
Signed-off-by: Willie Wiholm <willie.wiholm@tritechsolutions.se>
---
drivers/net/phy/dp83867.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index e3617f01b5d9..d997e10cd5ef 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -712,6 +712,22 @@ static int dp83867_of_init(struct phy_device *phydev)
static int dp83867_suspend(struct phy_device *phydev)
{
+ int ret;
+
+ /* The PHY must stay powered up for WoL. Without a PHY IRQ nothing
+ * reads ISR, so a WoL event latched while the system was running
+ * keeps INT/PWDN_N asserted and the next magic packet does not
+ * wake the system. Clear it before suspend.
+ */
+ if (phydev->wol_enabled) {
+ if (!phy_interrupt_is_valid(phydev)) {
+ ret = phy_read(phydev, MII_DP83867_ISR);
+ if (ret < 0)
+ return ret;
+ }
+ return 0;
+ }
+
/* Disable PHY Interrupts */
if (phy_interrupt_is_valid(phydev)) {
phydev->interrupts = PHY_INTERRUPT_DISABLED;
@@ -1274,6 +1290,7 @@ static struct phy_driver dp83867_driver[] = {
.phy_id_mask = 0xfffffff0,
.name = "TI DP83867",
/* PHY_GBIT_FEATURES */
+ .flags = PHY_ALWAYS_CALL_SUSPEND,
.probe = dp83867_probe,
.config_init = dp83867_config_init,
--
2.43.0
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads