0002-wifi-ath11k-Don-t-exit-on-wakeup-failure.patch 1.7 KB

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