RE: [PATCH rtw-next v12 2/3] wifi: rtw88: support channel switch in AP mode
From: Ping-Ke Shih
Date: Thu Nov 19 2026 - 00:28:44 EST
> -----Original Message-----
> From: Luka Gejak <luka.gejak@xxxxxxxxx>
> Sent: Thursday, November 19, 2026 12:43 PM
> To: Ping-Ke Shih <pkshih@xxxxxxxxxxx>; Mehmet Fide <mehmet.fide@xxxxxxxxx>
> Cc: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; mehmet.fide@xxxxxxxxxxxxxxxxxx
> Subject: RE: [PATCH rtw-next v12 2/3] wifi: rtw88: support channel switch in AP mode
>
>
> External mail : This email originated from outside the organization. Do not reply, click links, or open
> attachments unless you recognize the sender and know the content is safe.
>
>
>
> On November 19, 2026 1:51:06 AM GMT+01:00, Ping-Ke Shih
> <pkshih@xxxxxxxxxxx> wrote:
> >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.
>
> I agree. I think the benefit of handling an allocation failure needs to
> justify the extra complexity. I'll keep that in mind in future reviews.
>
> >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.
> >
>
> Do you mind explaining which LLM are you referring to? Perhaps sashiko?
I'm not sure if you find this allocation failure case by LLM or not, but
I'm sure LLM can report this kind of "problems". Just want to record
that we don't need to process them perfectly.
By the way, everyone uses LLM regularly, so I don't mind people use them.
However, I need to learn how to co-work with LLM and patches generated
by LLM.