0017-wifi-ath11k-Trigger-sta-disconnect-on-hardware-resta.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. From a018750a2cceaf4427c4ee3d9ce3e83a171d5bd6 Mon Sep 17 00:00:00 2001
  2. From: Youghandhar Chintala <quic_youghand@quicinc.com>
  3. Date: Fri, 4 Nov 2022 14:24:03 +0530
  4. Subject: [PATCH] wifi: ath11k: Trigger sta disconnect on hardware restart
  5. Currently after the hardware restart triggered from the driver, the
  6. station interface connection remains intact, since a disconnect trigger
  7. is not sent to userspace. This can lead to a problem in targets where
  8. the wifi mac sequence is added by the firmware.
  9. After the target restart, its wifi mac sequence number gets reset to
  10. zero. Hence AP to which our device is connected will receive frames with
  11. a wifi mac sequence number jump to the past, thereby resulting in the
  12. AP dropping all these frames, until the frame arrives with a wifi mac
  13. sequence number which AP was expecting.
  14. To avoid such frame drops, its better to trigger a station disconnect
  15. upon target hardware restart which can be done with API
  16. ieee80211_reconfig_disconnect exposed to mac80211.
  17. The other targets are not affected by this change, since the hardware
  18. params flag is not set.
  19. Reported-by: kernel test robot <lkp@intel.com>
  20. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
  21. Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com>
  22. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  23. Link: https://lore.kernel.org/r/20221104085403.11025-1-quic_youghand@quicinc.com
  24. ---
  25. drivers/net/wireless/ath/ath11k/core.c | 6 ++++++
  26. drivers/net/wireless/ath/ath11k/hw.h | 1 +
  27. drivers/net/wireless/ath/ath11k/mac.c | 7 +++++++
  28. 3 files changed, 14 insertions(+)
  29. --- a/drivers/net/wireless/ath/ath11k/core.c
  30. +++ b/drivers/net/wireless/ath/ath11k/core.c
  31. @@ -195,6 +195,7 @@ static const struct ath11k_hw_params ath
  32. .tcl_ring_retry = true,
  33. .tx_ring_size = DP_TCL_DATA_RING_SIZE,
  34. .smp2p_wow_exit = false,
  35. + .support_fw_mac_sequence = false,
  36. },
  37. {
  38. .name = "qca6390 hw2.0",
  39. @@ -277,6 +278,7 @@ static const struct ath11k_hw_params ath
  40. .tcl_ring_retry = true,
  41. .tx_ring_size = DP_TCL_DATA_RING_SIZE,
  42. .smp2p_wow_exit = false,
  43. + .support_fw_mac_sequence = true,
  44. },
  45. {
  46. .name = "qcn9074 hw1.0",
  47. @@ -356,6 +358,7 @@ static const struct ath11k_hw_params ath
  48. .tcl_ring_retry = true,
  49. .tx_ring_size = DP_TCL_DATA_RING_SIZE,
  50. .smp2p_wow_exit = false,
  51. + .support_fw_mac_sequence = false,
  52. },
  53. {
  54. .name = "wcn6855 hw2.0",
  55. @@ -438,6 +441,7 @@ static const struct ath11k_hw_params ath
  56. .tcl_ring_retry = true,
  57. .tx_ring_size = DP_TCL_DATA_RING_SIZE,
  58. .smp2p_wow_exit = false,
  59. + .support_fw_mac_sequence = true,
  60. },
  61. {
  62. .name = "wcn6855 hw2.1",
  63. @@ -519,6 +523,7 @@ static const struct ath11k_hw_params ath
  64. .tcl_ring_retry = true,
  65. .tx_ring_size = DP_TCL_DATA_RING_SIZE,
  66. .smp2p_wow_exit = false,
  67. + .support_fw_mac_sequence = true,
  68. },
  69. {
  70. .name = "wcn6750 hw1.0",
  71. @@ -597,6 +602,7 @@ static const struct ath11k_hw_params ath
  72. .tcl_ring_retry = false,
  73. .tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750,
  74. .smp2p_wow_exit = true,
  75. + .support_fw_mac_sequence = true,
  76. },
  77. };
  78. --- a/drivers/net/wireless/ath/ath11k/hw.h
  79. +++ b/drivers/net/wireless/ath/ath11k/hw.h
  80. @@ -219,6 +219,7 @@ struct ath11k_hw_params {
  81. bool tcl_ring_retry;
  82. u32 tx_ring_size;
  83. bool smp2p_wow_exit;
  84. + bool support_fw_mac_sequence;
  85. };
  86. struct ath11k_hw_ops {
  87. --- a/drivers/net/wireless/ath/ath11k/mac.c
  88. +++ b/drivers/net/wireless/ath/ath11k/mac.c
  89. @@ -8010,6 +8010,7 @@ ath11k_mac_op_reconfig_complete(struct i
  90. struct ath11k *ar = hw->priv;
  91. struct ath11k_base *ab = ar->ab;
  92. int recovery_count;
  93. + struct ath11k_vif *arvif;
  94. if (reconfig_type != IEEE80211_RECONFIG_TYPE_RESTART)
  95. return;
  96. @@ -8045,6 +8046,12 @@ ath11k_mac_op_reconfig_complete(struct i
  97. ath11k_dbg(ab, ATH11K_DBG_BOOT, "reset success\n");
  98. }
  99. }
  100. + if (ar->ab->hw_params.support_fw_mac_sequence) {
  101. + list_for_each_entry(arvif, &ar->arvifs, list) {
  102. + if (arvif->is_up && arvif->vdev_type == WMI_VDEV_TYPE_STA)
  103. + ieee80211_hw_restart_disconnect(arvif->vif);
  104. + }
  105. + }
  106. }
  107. mutex_unlock(&ar->conf_mutex);