wifi: ath12k: flush all packets before suspend
authorBaochen Qiang <quic_bqiang@quicinc.com>
Mon, 22 Apr 2024 12:11:45 +0000 (15:11 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Tue, 23 Apr 2024 09:27:15 +0000 (12:27 +0300)
commit692921ead832c0fccbf2b426140917333312a7f1
treef8ca4625ded44989532f28713cbaac22d2818d84
parent7b3d4eb283d2ee6323c60e7bc523cb7bef3c7fc1
wifi: ath12k: flush all packets before suspend

In order to send out all packets before going to suspend, current code
adds a 500ms delay as a workaround. It is a rough estimate and may not
work.

Fix this by checking packet counters, if counters become zero, then all
packets are sent out or dropped.

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-7-quic_bqiang@quicinc.com
drivers/net/wireless/ath/ath12k/core.c
drivers/net/wireless/ath/ath12k/mac.c
drivers/net/wireless/ath/ath12k/mac.h