NetworkManager tears down wlan0 on PrepareForSleep, so wake-on-WLAN only works on suspend paths logind never hears about
scope: device:google-taimen · severity: finding · confidence: proven · subsystem: wifi
The earlier WoL result was real but did not generalise, and this is the
qualification. It was measured with
PORTHOLE_SUSPEND_CMD='systemctl start systemd-suspend.service', which starts
the unit directly. logind never emits PrepareForSleep, so NetworkManager
never learns a suspend is happening, the association survives, and the magic
packet lands.
A real suspend – idle, or systemctl suspend – goes through logind, and one
second before the kernel enters s2idle:
device (wlan0): state change: disconnected -> unmanaged (reason 'unmanaged-nm-disabled')device (wlan0): reset MAC address to 02:00:2F:8E:8A:4F (unmanage)wpa_supplicant: nl80211: deinit ifname=wlan0Reached target SleepThere is nothing left to wake. The kernel’s WoWLAN is still armed – iw phy0 wowlan show reports magic-packet and disconnect throughout – and it is
irrelevant, because the interface it was armed on has been torn down and even
had its MAC changed underneath it.
The fix is one per-connection property, and it cannot be shipped as a default.
nmcli connection modify <conn> 802-11-wireless.wake-on-wlan magic # 0x1 (default) -> 0x8 (magic)With it set, no unmanage line appears at suspend and the packet wakes the
phone in 1 s, pm_wakeup_irq=132. Both conf.d spellings were tried and
neither reaches the property – [connection] wifi.wake-on-wlan=magic and the
long 802-11-wireless.wake-on-wlan=magic both leave it at 0x1 (default)
after a config reload. So the device package ships a dispatcher
(90-taimen-wowlan) that sets it on the connection the first time a wifi
device comes up, guarded on the current value because modifying a connection
re-triggers the dispatcher.
Two things this kills. A magic packet that fails is not evidence of a
wrong or randomised MAC – NM’s cloned address here is stable and was
byte-identical across every reboot of the session. And iw phy0 wowlan show
reporting “enabled” is not evidence that WoL can work; it survives the very
teardown that makes it useless.
