Re: [PATCH rtw-next v12 2/3] wifi: rtw88: support channel switch in AP mode
From: Luka Gejak
Date: Wed Nov 18 2026 - 03:19:51 EST
Hi Mehmet,
One more thing in addition to sashiko's comment.
On November 18, 2026 12:26:23 AM GMT+01:00, Mehmet Fide
<mehmet.fide@xxxxxxxxx> wrote:
> @@ -493,11 +513,17 @@ static void rtw_ops_stop_ap(struct ieee80211_hw *hw,
> struct rtw_dev *rtwdev = hw->priv;
>
> mutex_lock(&rtwdev->mutex);
> + rtw_fw_csa_stop(rtwdev, vif);
> rtw_write32_clr(rtwdev, REG_TCR, BIT_TCR_UPDATE_HGQMD);
> rtw_write16(rtwdev, REG_ATIMWND, ATIMWND_DEFAULT);
> rtwdev->ap_active = false;
> - if (!rtw_core_check_sta_active(rtwdev))
> + if (!rtw_core_check_sta_active(rtwdev)) {
> rtw_clear_op_chan(rtwdev);
> + } else {
> + /* what a countdown may have held back */
> + rtw_fw_download_rsvd_page(rtwdev);
> + rtw_send_rsvd_page_h2c(rtwdev);
> + }
As far as I can see, this check can still miss the station.
rtw_core_check_sta_active() uses rtw_iterate_vifs(), whose collecting
callback skips an interface if its GFP_ATOMIC allocation fails.
If the station associated after the last countdown download, its page
update was deferred above. Skipping that station here leaves the
countdown cancelled without refreshing those templates or sending their
locations to the firmware. There is no next work to carry the update.
I think the presence check is better fixed in
rtw_core_check_sta_active(). Its callback only reads interface state, so
could it use an atomic interface iterator without allocating entries?
Best regards,
Luka Gejak