Skip to contentSkip to conversation

wifi: ath9k_htc: clear csa_vif when a switch is aborted

PATCH Applied Mehmet Fide 3 participants 3 messages Oct 26 – Nov 16 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath9k_htc: clear csa_vif when a switch is aborted

From: Mehmet Fide <[email protected]>

priv->csa_vif is cleared only when the countdown completes or the interface is removed. When mac80211 aborts a switch and stops beaconing, as ieee80211_stop_ap() and ieee80211_stop_mesh() do, it stays set, and the next switch on the interface hits the WARN_ON() in ath9k_htc_channel_switch_beacon().

Clear it when beaconing stops and the switch is no longer active. Off channel, beaconing stops with the switch still active and the countdown continues afterwards, so keep it then.

Fixes f0e449627e4a ("ath9k_htc: add support of channel switch")

---

Notes:
Tested on an AR9271 (firmware 1.4), 6.12.114, also with PROVE_LOCKING and DEBUG_ATOMIC_SLEEP. A mesh point left during its countdown and joined again hit the WARN on the next switch 3/3 before, 0/8 after. An IBSS does the same with [1] applied: 13/13 before, 0/35 after. A scan during an IBSS countdown still lets the switch complete (24/24).

[1] https://lore.kernel.org/linux-wireless/[email protected]/

 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +3 -0
index 0d6272ac0dac..8080fff765e9 100644
@@ -1569,6 +1569,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
 			priv->cur_beacon_conf.enable_beacon = 0;
 			ath9k_htc_beacon_config(priv, vif);
 		}
+
+		if (priv->csa_vif == vif && !bss_conf->csa_active)
+			priv->csa_vif = NULL;
 	}
 
 	if (changed & BSS_CHANGED_BEACON_INT) {

base-commit: 9d8ec0b5b5295bd23d979d1b2b905de25c36fff2

Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Mehmet Fide

From: Mehmet Fide <[email protected]>

priv->csa_vif is cleared only when the countdown completes or the interface is removed. When mac80211 aborts a switch and stops beaconing, as ieee80211_stop_ap() and ieee80211_stop_mesh() do, it stays set, and the next switch on the interface hits the WARN_ON() in ath9k_htc_channel_switch_beacon().

Clear it when beaconing stops and the switch is no longer active. Off channel, beaconing stops with the switch still active and the countdown continues afterwards, so keep it then.

Quoted 5 lines
Fixes f0e449627e4a ("ath9k_htc: add support of channel switch")

---

Not an expert on ath family but, to my knowledge this is good.

Best regards,
Luka Gejak

maintainer Applied
#2 lore raw
In reply to Mehmet Fide
Quoted 1 line · Mehmet Fide

wifi: ath9k_htc: clear csa_vif when a switch is aborted

Applied to toke/ath9k-pending.git (main), thanks!

[1/1] wifi: ath9k_htc: clear csa_vif when a switch is aborted

      commit: f915ef9291f590deba4b9baf85a5f5a602061b4a

-Toke