Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5
@ 2026-11-16  9:17 Magnus Leatti
  2026-11-16  9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Magnus Leatti @ 2026-11-16  9:17 UTC (permalink / raw)
  To: me, Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Maxime Coquelin, Alexandre Torgue, Giuseppe Nespolino, netdev,
	linux-stm32, linux-arm-kernel, linux-kernel

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-16 17:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  9:17 [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5 Magnus Leatti
2026-11-16  9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
2026-11-16 14:33   ` Yao Zi
2026-11-16 14:58     ` Magnus Leatti
2026-11-16  9:17 ` [PATCH net-next 2/2] net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5 Magnus Leatti
2026-11-16 15:08   ` Yao Zi
2026-11-16 15:17     ` Yao Zi
2026-11-16 16:48       ` Magnus Leatti
2026-11-16 17:26         ` Yao Zi
2026-11-16 11:23 ` [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and " Giuseppe Nespolino
2026-11-16 11:36   ` Magnus Leatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox