Re: [PATCH rtw-next v5 3/3] wifi: rtw88: support channel switch in AP mode
From: Mehmet Fide
Date: Mon Oct 12 2026 - 03:01:15 EST
Hi Ping-Ke,
On 2026-10-12 Ping-Ke Shih wrote:
> > - if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags))
> > + if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags) ||
> > + rtw_fw_csa_active(rtwdev))
>
> As my comment in patch 2/3, I think we should cancel the work at core_stop.
Yes. In v6 rtw_core_stop() cancels csa_beacon_work next to
update_beacon_work and clears csa_vif, which also covers the firmware
recovery, so the wiphy_lock() in rtw_fw_recovery_work() goes away.
> > + if (conf->csa_active)
> > + rtw_fw_csa_start(rtwdev, vif);
>
> Is this a necessary case? Can't rtw_ops_channel_switch_beacon() handle it?
It is the restart case. After ieee80211_restart_hw(),
ieee80211_reconfig() replays BSS_CHANGED_BEACON with csa_active still
set, and drv_channel_switch_beacon() is only called from
__ieee80211_channel_switch(), so without this the countdown would not
resume after a firmware recovery. v6 says so in a comment, and the
same path stops the countdown when the beacon comes back without
csa_active, which is how mac80211 ends a switch.
Mehmet