linux/drivers/net/wireless/ath/ath12k
Baochen Qiang 8d5f4da8d7 wifi: ath12k: support suspend/resume
Now that all infrastructure is in place and ath12k is fixed to handle all the
corner cases, power down the ath12k firmware during suspend and power it back
up during resume.

For suspend, two conditions needs to be satisfied:

1. since MHI channel unprepare would be done in late suspend stage,
   ath12k needs to get all QMI-dependent things done before that stage.
2. and because unprepare MHI channels requires a working MHI stack,
   ath12k is not allowed to call mhi_power_down() until that finishes.

So the original suspend callback is separated into two parts: the first part
handles all QMI-dependent things in suspend callback; while the second part
powers down MHI in suspend_late callback. This is valid because kernel calls
ath12k's suspend callback before calling all suspend_late callbacks, making
the first condition satisfied. And because MHI devices are children of ath12k
device (ab->dev), kernel guarantees that ath12k's suspend_late callback is
called after QRTR's suspend_late callback, this satisfies the second condition.

Above analysis also applies to resume process. so the original resume
callback is separated into two parts: the first part powers up MHI stack
in resume_early callback, this guarantees MHI stack is working when
QRTR tries to prepare MHI channels (kernel calls QRTR's resume_early callback
after ath12k's resume_early callback, due to the child-father relationship);
the second part waits for the completion of restart, which would succeed
since MHI channels are ready for use by QMI.

Another notable change is in power down path, we tell mhi_power_down() to not
to destroy MHI devices, making it possible for QRTR to help unprepare/prepare
MHI channels, and finally get us rid of the potential probe-defer issue when
resume.

Also change related code due to interface changes.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240412060620.27519-10-quic_bqiang@quicinc.com
2024-04-23 12:27:16 +03:00
..
ce.c
ce.h
core.c wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
core.h wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
dbring.c
dbring.h
debug.c
debug.h
debugfs.c wifi: ath12k: debugfs: radar simulation support 2024-04-04 13:07:06 +03:00
debugfs.h wifi: ath12k: initial debugfs support 2024-04-04 13:07:06 +03:00
dp.c wifi: ath12k: Refactor data path cmem init 2024-04-22 15:06:31 +03:00
dp.h wifi: ath12k: displace the Tx and Rx descriptor in cookie conversion table 2024-04-22 15:06:31 +03:00
dp_mon.c wifi: ath12k: don't use %pK in dmesg format strings 2024-04-18 18:24:08 +03:00
dp_mon.h
dp_rx.c wifi: ath12k: no need to handle pktlog during suspend/resume 2024-04-23 12:27:15 +03:00
dp_rx.h wifi: ath12k: no need to handle pktlog during suspend/resume 2024-04-23 12:27:15 +03:00
dp_tx.c wifi: ath12k: fix desc address calculation in wbm tx completion 2024-03-20 12:06:10 +02:00
dp_tx.h
fw.c wifi: ath12k: Read board id to support split-PHY QCN9274 2024-02-02 14:32:52 +02:00
fw.h wifi: ath12k: Read board id to support split-PHY QCN9274 2024-02-02 14:32:52 +02:00
hal.c wifi: ath12k: add MAC id support in WBM error path 2024-02-02 14:32:51 +02:00
hal.h wifi: ath12k: fix hal_rx_buf_return_buf_manager documentation 2024-04-04 13:10:48 +03:00
hal_desc.h
hal_rx.c
hal_rx.h
hal_tx.c
hal_tx.h
hif.h wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
htc.c wifi: ath12k: don't use %pK in dmesg format strings 2024-04-18 18:24:08 +03:00
htc.h
hw.c wifi: ath12k: advertise P2P dev support for WCN7850 2024-02-07 17:07:00 +02:00
hw.h wifi: ath12k: vdev statemachine changes for single wiphy 2024-04-10 17:12:14 +03:00
Kconfig wifi: ath12k: initial debugfs support 2024-04-04 13:07:06 +03:00
mac.c wifi: ath12k: flush all packets before suspend 2024-04-23 12:27:15 +03:00
mac.h wifi: ath12k: flush all packets before suspend 2024-04-23 12:27:15 +03:00
Makefile wifi: ath12k: initial debugfs support 2024-04-04 13:07:06 +03:00
mhi.c wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
mhi.h wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
p2p.c wifi: ath12k: Add additional checks for vif and sta iterators 2024-04-10 17:12:15 +03:00
p2p.h wifi: ath12k: Add additional checks for vif and sta iterators 2024-04-10 17:12:15 +03:00
pci.c wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
pci.h wifi: ath12k: support suspend/resume 2024-04-23 12:27:16 +03:00
peer.c
peer.h
qmi.c wifi: ath12k: do not dump SRNG statistics during resume 2024-04-23 12:27:14 +03:00
qmi.h wifi: ath12k: fix kernel crash during resume 2024-04-23 12:25:29 +03:00
reg.c wifi: ath12k: modify regulatory support for single wiphy architecture 2024-04-10 17:12:15 +03:00
reg.h
rx_desc.h wifi: ath12k: add MAC id support in WBM error path 2024-02-02 14:32:51 +02:00
trace.c
trace.h
wmi.c wifi: ath12k: fix warning on DMA ring capabilities event 2024-04-23 12:27:14 +03:00
wmi.h wifi: ath12k: enable service flag for survey dump stats 2024-04-18 18:21:48 +03:00