[PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5

From: Magnus Leatti

Date: Mon Nov 16 2026 - 04:18:26 EST


The YT6801 accepts "ethtool -s eth0 wol g" today and then ignores magic
packets once the system is powered off. This series makes S5
Wake-on-LAN work. Both patches touch only the glue.

Patch 1 adds a shutdown hook that stops the device. The glue has none,
so the MAC and DMA keep running into reboot and kexec.

Patch 2 arms the chip when powering off with Wake-on-LAN set. The
sequence follows the vendor driver, with two differences that come
from measurements on the test board:

- The function stays in D0 instead of D3hot. With MAC Wake-on-LAN
phylib keeps polling the PHY until power is removed, and in D3hot
that poll fails with -EBUSY and warns from phy_error_precise(). It
happened 111 ms after D3hot on a normal power-off.
- Bit 9 of LPW_CTRL is not set. The chip wakes without it.

Every write that is left was removed once to see what it does: without
OOB WoL or the packet wake bit there is no wake. Without the MAC
address rewrite, or without the 2 ms wait before it, the chip wakes on
the factory address only.

Tested on a Celeron N3350 mini PC, net-next at 6964ff21c5d8:

net-next wol g no wake, 3 of 3
patched wol g wake, 8 of 8
patched wol u wake on unicast, 1 of 1
patched wol d no wake, 3 of 3
patched wol g, interface down no wake, 1 of 1
patched wol g, power/wakeup disabled no wake, 1 of 1
patched wol g, reboot reboots, link back, 3 of 3

A second board, a PSJ8500-N97 mini PC (Intel N97), behaves the same.

This series does S5 only, on purpose. S5 wake is the important case
and it is not implemented. The change for it is small and stays in the
glue. Wake from suspend and hibernation has a larger blast radius.

Giuseppe, this is the OOB WoL enable you and Yao discussed in the
s2idle thread [1]: it is only enabled when powering off, because only
a chip reset disables it again. If you can try "wol g" and a power-off
on the Slimbook, a laptop would be a good third board.

[1] https://lore.kernel.org/netdev/apSDPwF49Z1Zd0kJ@pie/

Magnus Leatti (2):
net: stmmac: dwmac-motorcomm: quiesce the device at shutdown
net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5

.../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)


base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
--
2.56.1