mac80211: add ath11k PCI support
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / ath11k / 0002-wifi-ath11k-Don-t-exit-on-wakeup-failure.patch
1 From 45d2e268369b0c768d5a644f319758bcfd370521 Mon Sep 17 00:00:00 2001
2 From: Baochen Qiang <quic_bqiang@quicinc.com>
3 Date: Wed, 28 Sep 2022 09:51:40 +0800
4 Subject: [PATCH] wifi: ath11k: Don't exit on wakeup failure
5
6 Currently, ath11k_pcic_read() returns an error if wakeup()
7 fails, this makes firmware crash debug quite hard because we can
8 get nothing.
9
10 Change to go ahead on wakeup failure, in that case we still may
11 get something valid to check. There should be no mislead due
12 to incorrect content because we are aware of the failure with the
13 log printed.
14
15 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
16
17 Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
18 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
19 Link: https://lore.kernel.org/r/20220928015140.5431-1-quic_bqiang@quicinc.com
20 ---
21 drivers/net/wireless/ath/ath11k/pcic.c | 13 ++++++++++---
22 1 file changed, 10 insertions(+), 3 deletions(-)
23
24 --- a/drivers/net/wireless/ath/ath11k/pcic.c
25 +++ b/drivers/net/wireless/ath/ath11k/pcic.c
26 @@ -218,9 +218,16 @@ int ath11k_pcic_read(struct ath11k_base
27 if (wakeup_required && ab->pci.ops->wakeup) {
28 ret = ab->pci.ops->wakeup(ab);
29 if (ret) {
30 - ath11k_warn(ab, "failed to wakeup for read from 0x%x: %d\n",
31 - start, ret);
32 - return ret;
33 + ath11k_warn(ab,
34 + "wakeup failed, data may be invalid: %d",
35 + ret);
36 + /* Even though wakeup() failed, continue processing rather
37 + * than returning because some parts of the data may still
38 + * be valid and useful in some cases, e.g. could give us
39 + * some clues on firmware crash.
40 + * Mislead due to invalid data could be avoided because we
41 + * are aware of the wakeup failure.
42 + */
43 }
44 }
45