[PATCH v2 2/2] wifi: ath10k: report WoW wakeups to the PM core

From: Michael Auer

Date: Sat Nov 21 2026 - 09:01:55 EST


ath10k does not report a WoW wakeup to the PM core, so the wakeup
source of the device never counts it, and user space cannot tell a
network wakeup from other resumes. Plasma's powerdevil, for example,
checks the wakeup_count of each wakeup source after resume. It keeps
the display off after a network wakeup and turns it on otherwise.

Call pm_wakeup_event() when the firmware reports a wake reason other
than WOW_REASON_UNSPECIFIED, which it uses when the host resumed for
another reason. iwlwifi does the same since commit 06ae2ad413d2
("iwlwifi: mvm: report wakeup for wowlan").

Report it before completing wow.wakeup_completed. Once the resume path
continues, the system resume can finish and stop counting wakeup
events before the report.

On a OnePlus 6 the wakeup source of the WLAN device now counts WoW
wakeups, and powerdevil keeps the display off for them.

Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.2.0.c8-00050-QCAHLSWMTPLZ-1

Signed-off-by: Michael Auer <mick@xxxxxxxx>
---
v2: report the wakeup before complete(), also on the parse error path

drivers/net/wireless/ath/ath10k/wmi.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index eca6bb189577..e12fdd5aabc8 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4665,16 +4665,23 @@ void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb)
struct wmi_wow_ev_arg ev = {};
int ret;

- complete(&ar->wow.wakeup_completed);
-
ret = ath10k_wmi_pull_wow_event(ar, skb, &ev);
if (ret) {
ath10k_warn(ar, "failed to parse wow wakeup event: %d\n", ret);
- return;
+ goto out;
}

ath10k_dbg(ar, ATH10K_DBG_WMI, "wow wakeup host reason %d %s\n",
ev.wake_reason, wow_reason(ev.wake_reason));
+
+ /* UNSPECIFIED: the host resumed for another reason. Report before
+ * the completion, so the system resume cannot finish first.
+ */
+ if (ev.wake_reason != WOW_REASON_UNSPECIFIED)
+ pm_wakeup_event(ar->dev, 0);
+
+out:
+ complete(&ar->wow.wakeup_completed);
}

void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb)
--
2.43.0