The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Mehmet Fide <mehmet.fide@gmail.com>, Ping-Ke Shih <pkshih@realtek.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>,
	Zong-Zhe Yang <kevin_yang@realtek.com>,
	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-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	mehmet.fide@screeningeagle.com
Subject: Re: [PATCH rtw-next v3 1/5] wifi: rtw88: free the reserved pages of an interface on firmware recovery
Date: Fri, 20 Nov 2026 14:09:16 +0100	[thread overview]
Message-ID: <20261120131000.33858-1-luka.gejak@linux.dev> (raw)
In-Reply-To: <20261117171003.1840491-2-mehmet.fide@gmail.com>

Hi Mehmet,

Thanks for the update. Two comments below.

On November 17, 2026 6:09:59 PM GMT+01:00, Mehmet Fide
<mehmet.fide@gmail.com> wrote:

> @@ -1765,6 +1768,9 @@ int rtw_fw_download_rsvd_page(struct rtw_dev *rtwdev)
>  	u32 size;
>  	int ret;
>
> +	if (bitmap_empty(rtwdev->hw_port, RTW_PORT_NUM))
> +		return 0;
> +
>  	buf = rtw_build_rsvd_page(rtwdev, &size);

Could this skip a download that WoWLAN needs? If suspend flushes the
recovery work while it holds RTNL, ieee80211_restart_work() cannot add
the interfaces back before rtw_wow_suspend() runs. With net detect
configured, the station interface can still be picked for WoWLAN.
rtw_wow_leave_no_link_ps() can power the device back up without setting
the port bitmap again.

So rtw_wow_config_wow_fw_rsvd_page() adds the scan pages, but the check
above returns success before downloading them. rtw_wow_fw_start() then
tries to enable net detect with a zero page location for the NLO and
channel tables. Could we keep the skip in the beacon update paths, or
have suspend fall back to the normal suspend path when a restart is
pending?

[ ... ]

> @@ -633,6 +633,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);

I think the empty list warning can still happen with AP and station
interfaces on the RTL8822C. If a station interface comes up after the
reset clears the bitmap, rtw_ops_add_interface() sets a port before
ieee80211_do_open() marks the interface running. The AP still has an
empty list, and the page iterator skips the station interface until it
is running.

Can a TIM update from the AP run in that gap? For example, the station
cleanup timer can expire a buffered frame after rtw_core_stop() cancels
the beacon work. The worker can then see a port in use and still hit
"Should not have an empty reserved page". Would it make sense to free
the old pages before reinitializing the list when adding an interface
that was already initialized, as Zong-Zhe suggested?

https://lore.kernel.org/linux-wireless/96da951407ab4c39b7e229ca365950eb@realtek.com/

Best regards,
Luka Gejak

  reply	other threads:[~2026-11-20 13:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 17:09 [PATCH rtw-next v3 0/5] wifi: rtw88: fixes around the firmware recovery Mehmet Fide
2026-11-17 17:09 ` [PATCH rtw-next v3 1/5] wifi: rtw88: free the reserved pages of an interface on " Mehmet Fide
2026-11-20 13:09   ` Luka Gejak [this message]
2026-11-17 17:10 ` [PATCH rtw-next v3 2/5] wifi: rtw88: report the frames purged from the TX report queue Mehmet Fide
2026-11-20 13:09   ` Luka Gejak
2026-11-17 17:10 ` [PATCH rtw-next v3 3/5] wifi: rtw88: do not drop stations when collecting them for an iteration Mehmet Fide
2026-11-20 13:09   ` Luka Gejak
2026-11-17 17:10 ` [PATCH rtw-next v3 4/5] wifi: rtw88: reset the stations outside of RCU on firmware recovery Mehmet Fide
2026-11-17 17:10 ` [PATCH rtw-next v3 5/5] wifi: rtw88: clear the restart flag when the device is stopped Mehmet Fide
2026-11-17 23:15   ` Mehmet Fide
2026-11-18  0:45     ` Ping-Ke Shih
2026-11-19 14:31 ` [PATCH rtw-next v3 0/5] wifi: rtw88: fixes around the firmware recovery 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=20261120131000.33858-1-luka.gejak@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=s.hauer@pengutronix.de \
    --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