1
0

0001-wifi-ath11k-stop-tx-queues-immediately-upon-firmware.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From 81e60b2dfb2744ab6642c4aa62534b4f711fdc5d Mon Sep 17 00:00:00 2001
  2. From: Aditya Kumar Singh <quic_adisi@quicinc.com>
  3. Date: Tue, 27 Sep 2022 09:18:54 +0300
  4. Subject: [PATCH] wifi: ath11k: stop tx queues immediately upon firmware exit
  5. Currently, recovery flag is set immediately upon firmware
  6. exit but tx queues are stopped once firmware arrives back
  7. and is ready which is during ath11k_core_restart. Once
  8. ieee80211 hw restart is completed, tx queues are resumed.
  9. If during the time delta between firmware exit and firmware
  10. ready, mac80211 send packets, currently ath11k will drop it
  11. since recovery flag will be set. But warning prints will
  12. come -
  13. "ath11k c000000.wifi: failed to transmit frame -108"
  14. If more tx packets are there, this could lead to flooding
  15. of above print.
  16. However, actually tx queues should be stopped immediately
  17. when firmware leaves. This will prevent packets to get
  18. dropped when firmware is recovering.
  19. Add fix to stop tx queues immediately after firmware exit.
  20. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
  21. Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
  22. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  23. Link: https://lore.kernel.org/r/20220923170235.18873-1-quic_adisi@quicinc.com
  24. ---
  25. drivers/net/wireless/ath/ath11k/core.c | 5 +----
  26. drivers/net/wireless/ath/ath11k/core.h | 1 +
  27. drivers/net/wireless/ath/ath11k/qmi.c | 3 +++
  28. 3 files changed, 5 insertions(+), 4 deletions(-)
  29. --- a/drivers/net/wireless/ath/ath11k/core.c
  30. +++ b/drivers/net/wireless/ath/ath11k/core.c
  31. @@ -1641,7 +1641,7 @@ static void ath11k_update_11d(struct wor
  32. }
  33. }
  34. -static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
  35. +void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
  36. {
  37. struct ath11k *ar;
  38. struct ath11k_pdev *pdev;
  39. @@ -1730,9 +1730,6 @@ static void ath11k_core_restart(struct w
  40. struct ath11k_base *ab = container_of(work, struct ath11k_base, restart_work);
  41. int ret;
  42. - if (!ab->is_reset)
  43. - ath11k_core_pre_reconfigure_recovery(ab);
  44. -
  45. ret = ath11k_core_reconfigure_on_crash(ab);
  46. if (ret) {
  47. ath11k_err(ab, "failed to reconfigure driver on crash recovery\n");
  48. --- a/drivers/net/wireless/ath/ath11k/core.h
  49. +++ b/drivers/net/wireless/ath/ath11k/core.h
  50. @@ -1158,6 +1158,7 @@ int ath11k_core_check_smbios(struct ath1
  51. void ath11k_core_halt(struct ath11k *ar);
  52. int ath11k_core_resume(struct ath11k_base *ab);
  53. int ath11k_core_suspend(struct ath11k_base *ab);
  54. +void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
  55. const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
  56. const char *filename);
  57. --- a/drivers/net/wireless/ath/ath11k/qmi.c
  58. +++ b/drivers/net/wireless/ath/ath11k/qmi.c
  59. @@ -3164,6 +3164,9 @@ static void ath11k_qmi_driver_event_work
  60. case ATH11K_QMI_EVENT_SERVER_EXIT:
  61. set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags);
  62. set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags);
  63. +
  64. + if (!ab->is_reset)
  65. + ath11k_core_pre_reconfigure_recovery(ab);
  66. break;
  67. case ATH11K_QMI_EVENT_REQUEST_MEM:
  68. ret = ath11k_qmi_event_mem_request(qmi);