Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Zong-Zhe Yang <kevin_yang@realtek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Mehmet Fide <mehmet.fide@gmail.com>,
	Ping-Ke Shih <pkshih@realtek.com>
Cc: Tzu-En Huang <tehuang@realtek.com>,
	Yan-Hsuan Chuang <yhchuang@realtek.com>,
	Kalle Valo <kvalo@kernel.org>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Brian Norris <briannorris@chromium.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mehmet.fide@screeningeagle.com" <mehmet.fide@screeningeagle.com>
Subject: Re: [PATCH rtw-next 1/3] wifi: rtw88: free the reserved pages of an interface on firmware recovery
Date: Fri, 13 Nov 2026 17:32:06 +0100	[thread overview]
Message-ID: <5FA04DA4-863E-46D3-A993-5F3C074ABC37@linux.dev> (raw)
In-Reply-To: <96da951407ab4c39b7e229ca365950eb@realtek.com>

On November 13, 2026 11:21:16 AM GMT+01:00, Zong-Zhe Yang
<kevin_yang@realtek.com> wrote:
>Luka Gejak <luka.gejak@linux.dev> wrote:
>> 
>> On November 11, 2026 10:32:37 PM GMT+01:00, Mehmet Fide
>> <mehmet.fide@gmail.com> wrote:
>> 
>> > diff --git a/drivers/net/wireless/realtek/rtw88/main.c
>> b/drivers/net/wireless/realtek/rtw88/main.c
>> > index f7708ad17b6f..adc54b063382 100644
>> > --- a/drivers/net/wireless/realtek/rtw88/main.c
>> > +++ b/drivers/net/wireless/realtek/rtw88/main.c
>> > @@ -627,6 +627,7 @@ static void rtw_reset_vif_iter(void *data, u8
>*mac,
>> struct ieee80211_vif *vif)
>> >       rtw_bf_disassoc(rtwdev, vif, NULL);
>> >       rtw_vif_assoc_changed(rtwvif, NULL);
>> >       rtw_txq_cleanup(rtwdev, vif->txq);
>> > +     rtw_remove_rsvd_page(rtwdev, rtwvif);
>> 
>> As far as I can see, update_beacon_work can still run after this reset
>> and before ieee80211_reconfig() adds the interfaces again.
>> rtw_core_stop() cancels it from rtw_enter_ips(), but rtw_ops_set_tim()
>> can queue it again right after, for example when a frame for a dozing
>> station gets buffered. ieee80211_restart_work() then flushes
>> local->workqueue before it calls ieee80211_reconfig().
>> 
>> So if I read it right, with an AP interface (ap_active stays set) the
>> work now finds every per vif list empty and runs into this in
>> __rtw_build_rsvd_page_from_vifs():
>> 
>>         rsvd_pkt = list_first_entry_or_null(&rtwdev->rsvd_page_list,
>>                                             struct rtw_rsvd_page,
>> build_list);
>>         if (!rsvd_pkt) {
>>                 WARN(1, "Should not have an empty reserved page\n");
>>                 return -EINVAL;
>>         }
>> 
>> Before this patch it built the page from the stale entries and did not
>> warn. Maybe rtw_fw_update_beacon_work() could skip the download while
>> RTW_FLAG_RESTARTING is set? The reconfig downloads the beacon again for
>> BSS_CHANGED_BEACON anyway.
>> 
>
>How about adding a flag to indicate if this rtwvif has been init-ed or not
>?
>If init-ed and rtw_ops_add_interface() again, call rtw_remove_rsvd_page()
>first.
>

Thank you for your suggestion. I am fine with either approach, as outcome
is the same either way. So Mehmet, choose whatever you are more comfortable
doing.

Best regards,
Luka Gejak

  reply	other threads:[~2026-11-13 16:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 21:32 [PATCH rtw-next 0/3] wifi: rtw88: three fixes around the firmware recovery Mehmet Fide
2026-11-11 21:32 ` [PATCH rtw-next 1/3] wifi: rtw88: free the reserved pages of an interface on " Mehmet Fide
2026-11-13  6:54   ` Luka Gejak
2026-11-13 10:21     ` Zong-Zhe Yang
2026-11-13 16:32       ` Luka Gejak [this message]
2026-11-13 17:24         ` Mehmet Fide
2026-11-11 21:32 ` [PATCH rtw-next 2/3] wifi: rtw88: report the frames purged from the TX report queue Mehmet Fide
2026-11-13  6:55   ` Luka Gejak
2026-11-11 21:32 ` [PATCH rtw-next 3/3] wifi: rtw88: reset the stations outside of RCU on firmware recovery Mehmet Fide
2026-11-13  6:57   ` Luka Gejak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5FA04DA4-863E-46D3-A993-5F3C074ABC37@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=briannorris@chromium.org \
    --cc=kevin_yang@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mehmet.fide@gmail.com \
    --cc=mehmet.fide@screeningeagle.com \
    --cc=pkshih@realtek.com \
    --cc=sgruszka@redhat.com \
    --cc=tehuang@realtek.com \
    --cc=yhchuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox