Re: [PATCH wireless-next] wifi: mac80211: replace the CSA beacon before clearing csa_active

From: Johannes Berg

Date: Tue Nov 24 2026 - 08:52:12 EST


On Tue, 2026-11-17 at 16:31 +0100, Mehmet Fide wrote:
> From: Mehmet Fide <mehmet.fide@xxxxxxxxxxxxxxxxxx>
>
> __ieee80211_csa_finalize() clears csa_active and only then replaces the
> CSA beacon with the one for after the switch. A driver that fetches its
> beacons with ieee80211_beacon_get() and skips them once the countdown
> is complete, as ath9k does in ath9k_csa_is_finished(), tests csa_active
> first. A beacon fetched between the two steps passes that test and gets
> the CSA beacon again, which goes out on the new channel, and
> ieee80211_beacon_get() reports "beacon TX faster than countdown".
>
> Replace the beacon first, as the finalize work did before the clear was
> moved ahead of it. csa_active is still cleared when replacing the
> beacon fails.
>
> Fixes: e487eaeb076a ("cfg80211/mac80211/ath6kl: acquire wdev lock outside ch_switch_notify")

I don't see why it would be that?? Please explain that.

johannes
--
pw-bot: cr