wifi: ath11k: choose default PM policy for hibernation
authorBaochen Qiang <quic_bqiang@quicinc.com>
Fri, 28 Mar 2025 05:32:28 +0000 (13:32 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 31 Mar 2025 21:43:12 +0000 (14:43 -0700)
commit32d93b51bc7e2e557771abe4a88da69c609e3d52
treec525163ca7ce98a8f21bebec13df54b7ad9057e9
parent88fd03cf51a7d67dac976ecce079ccfc79376966
wifi: ath11k: choose default PM policy for hibernation

Now WoWLAN mode is chosen for those machines listed in the quirk table.
This works for suspend (S3) but breaks for hibernation (S4), because
WoWLAN mode requires WLAN power to be sustained, which is not the case
during hibernation. For hibernation, the default mode should be used.

Register a PM notifier with which kernel can notify us of the actual PM
operation: if system is going to suspend, the original PM policy is
honored; while if it is hibernation, overwrite it with default policy.

To summarize: for suspend (S3), WoWLAN mode is chosen for machines listed
in the quirk table, non-WoWLAN mode for others; for hibernation (S4),
non-WoWLAN mode is chosen for all.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30

Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Link: https://patch.msgid.link/20250328-ath11k-bring-hibernation-back-v3-5-23405ae23431@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath11k/core.c
drivers/net/wireless/ath/ath11k/core.h
drivers/net/wireless/ath/ath11k/pci.c