Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH ath-next v2] wifi: ath9k: don't check CSA completion on station interfaces
@ 2026-11-27 22:03 Gaston Guevara
  0 siblings, 0 replies; only message in thread
From: Gaston Guevara @ 2026-11-27 22:03 UTC (permalink / raw)
  To: toke; +Cc: linux-wireless, Gaston Guevara

ath9k_csa_update() iterates over all active interfaces and calls
ath9k_csa_is_finished() for each of them. mac80211 also sets
bss_conf.csa_active on a station interface while it follows a channel
switch announced by its AP, so when an AP and a station share an ath9k
radio, ath9k_csa_is_finished() calls ieee80211_beacon_cntdwn_is_complete()
for the station vif. That function only handles AP, ad-hoc and mesh
interfaces and hits WARN_ON(1) for any other type, producing a burst of
warnings on upstream channel switches (about one every 200 ms in my
logs).

Skip station interfaces in the iterator callback,
ath9k_csa_update_vif(). A station legitimately reaches
ath9k_csa_is_finished() only through ath9k_csa_update(). Leave
ath9k_csa_is_finished() unchanged, so that the WARN_ON still reports a
wrong interface type arriving through its direct caller,
ath9k_beacon_tasklet(). A P2P client is NL80211_IFTYPE_STATION in
mac80211, so it is covered too. Ad-hoc and mesh interfaces keep their
current behaviour.

Fixes: 4effc6fda7ab ("ath9k: prepare for multi-interface CSA support")
Suggested-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://lore.kernel.org/linux-wireless/CABMxrRyvsFy7qGXky-OF1KE3c04z0xO_XMGnJC28L0WHE9AF9Q@mail.gmail.com/
Signed-off-by: Gaston Guevara <guevara.gaston@gmail.com>
---
v2: move the station check to the caller, ath9k_csa_update_vif(), so that
    ath9k_csa_is_finished() keeps warning on the direct path (Toke)
v1: https://lore.kernel.org/linux-wireless/20261123210815.25770-1-guevara.gaston@gmail.com/

Testing: v2 was build-tested on ath-next
(drivers/net/wireless/ath/ath9k/, MIPS, W=1, no warnings from the driver
sources) and run on a TP-Link Archer C60 v3 with an AP and a station on
the same radio, running OpenWrt r38494 (kernel 6.18.64). The hardware
test did not use ath-next: ath9k.ko was built out of tree with OpenWrt's
r38511 SDK (backports 7.2, with OpenWrt's other ath9k patches) and
loaded in place of the stock module. The mac80211.ko from that SDK build
is byte-identical to the one on the router.

With v2 loaded, from 26 to 27 November (about 22 hours), the station
followed 14 upstream channel switches. The AP logged AP-CSA-FINISHED
after all 14, with no WARNING and no reboot. The station lost beacons
and reconnected once, more than 4 minutes away from any channel switch;
I did not investigate it.

For comparison, v1 run the same way gave no WARNING over the 12 channel
switches quoted in v1 and a further 57 logged between 22 and 26
November. The only other direct caller, ath9k_beacon_tasklet(), takes
its vif from sc->beacon.bslot[], and only interfaces accepted by
ath9k_uses_beacons() get a slot.

For information only, not a claim about this patch: on 26 November the
router rebooted at about 06:05 with the v1 module loaded, 48 minutes
after the last logged channel switch, which had completed. The cause is
unknown. It then ran the stock module, and all of the next 10 upstream
channel switches logged this WARNING. 6 of them completed
(AP-CSA-FINISHED). The other 4 never logged AP-CSA-FINISHED and ended in
a reboot. No Oops or panic reached the remote syslog, so the cause is
unknown. The two periods were not randomized and the modules come from
different builds, so I can't say the reboots are caused by this path or
that the patch prevents them.

Tool use: an AI assistant (Claude) helped to locate the cause using the
router logs and the ath9k and mac80211 sources, and to prepare the code
change, the changelog and these notes. It also ran the build, checkpatch
and log checks mentioned here, and, with my approval, the commands that
loaded the test module. The placement of the check in v2 follows Toke's
review.

 drivers/net/wireless/ath/ath9k/beacon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 4a27e3753c03..061e96e3d4c1 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -375,6 +375,10 @@ bool ath9k_csa_is_finished(struct ath_softc *sc, struct ieee80211_vif *vif)
 static void ath9k_csa_update_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
 {
 	struct ath_softc *sc = data;
+
+	if (vif->type == NL80211_IFTYPE_STATION)
+		return;
+
 	ath9k_csa_is_finished(sc, vif);
 }
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-27 22:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 22:03 [PATCH ath-next v2] wifi: ath9k: don't check CSA completion on station interfaces Gaston Guevara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox