RE: [PATCH rtw-next v12 2/3] wifi: rtw88: support channel switch in AP mode

From: Ping-Ke Shih

Date: Wed Nov 18 2026 - 19:51:35 EST


Luka Gejak <luka.gejak@xxxxxxxxx> wrote:
> On November 18, 2026 10:14:17 AM GMT+01:00, Ping-Ke Shih
> <pkshih@xxxxxxxxxxx> wrote:
> >Mehmet Fide <mehmet.fide@xxxxxxxxx> wrote:
> >> > 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?
> >>
> >> Right, the callback does not sleep, so rtw_iterate_vifs_atomic() works
> >> there. The check is older than this series: since commit 96fbb84de4ff
> >> ("wifi: rtw88: handle station mode concurrent scan with AP mode") a
> >> failed allocation also makes rtw_clear_op_chan() drop the operating
> >> channel of an associated station, on BSS_CHANGED_BSSID and in
> >> rtw_ops_stop_ap().
> >>
> >> Ping-Ke, Luka: would you take that as a separate fix for rtw-next, or as
> >> a patch before this one in v13?
> >
> >I think rtw_core_check_sta_active() is used under wiphy lock, we can
> >migrate to use for_each_active_interface() with lockdep_assert_wiphy()
> >as a separate patch.
> >
>
> Works for me.

Think more about failing to allocate. I suppose kernel will throw out
a OOM message, so we can just handle the return NULL pointer to prevent
crash. To ensure function still works as normal under OOM situation,
it is not so easy. I guess we need to add many "special conditions",
and driver becomes hard to read.

So, my opinion is to do our best to keep function work under OOM.
No need to ensure everything work perfect.

For this case, it is not too hard to avoid the OOM case, so I agree
the change. But we don't always need to handle the case found by LLM.

Ping-Ke