From: Luka Gejak <luka.gejak@linux.dev>
To: Mehmet Fide <mehmet.fide@gmail.com>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
Bitterblue Smith <rtl8821cerfe2@gmail.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
mehmet.fide@screeningeagle.com
Subject: Re: [PATCH rtw-next v14 2/3] wifi: rtw88: support channel switch in AP mode
Date: Tue, 24 Nov 2026 01:24:36 +0100 [thread overview]
Message-ID: <20261124002437.213112-1-luka.gejak@linux.dev> (raw)
In-Reply-To: <20261121193644.603289-3-mehmet.fide@gmail.com>
Hi Mehmet,
Thanks for the v14. Six comments below.
On November 21, 2026 8:36:43 PM GMT+01:00, Mehmet Fide
<mehmet.fide@gmail.com> wrote:
> + rtwdev->csa_due = ktime_add_us(rtwdev->csa_due, interval);
> + delay = ktime_us_delta(rtwdev->csa_due, ktime_get());
> + ieee80211_queue_delayed_work(rtwdev->hw, &rtwdev->csa_beacon_work,
> + usecs_to_jiffies(max(delay, 0)));
With a count of 2, if the work runs more than one interval late, it can
install count 1 and queue the finish with no delay. It can then switch
before a TBTT has had a chance to send the count. Your v13 test with the
150 ms delay showed this with patch 2 alone.
Could the TBTT pacing from patch 3 go in here so the commit that enables
CSA also waits for that last TBTT?
https://lore.kernel.org/linux-wireless/20261120170322.375333-1-mehmet.fide@gmail.com/
[ ... ]
> + rtwdev->csa_retry = !!rtw_fw_download_rsvd_page(rtwdev);
> + if (!rtwdev->csa_retry)
> + rtw_send_rsvd_page_h2c(rtwdev);
> + rtw_fw_csa_queue(rtwdev, vif);
As far as I can see, mac80211 can stop the queues before the size check
in rtw_build_rsvd_page(). The hostapd message size limit covers that
client. nl80211_channel_switch() has no check against the chip's page
limit.
If the countdown beacon needs more pages than the chip has, retrying
the same count can't make it fit. The switch then stays pending, and
block_tx keeps the queues stopped. Could the driver reject a template
that cannot fit, or stop the AP if the download keeps failing?
[ ... ]
> if (changed & BSS_CHANGED_BEACON) {
> rtw_set_dtim_period(rtwdev, conf->dtim_period);
> - rtw_fw_download_rsvd_page(rtwdev);
> + ret = rtw_fw_download_rsvd_page(rtwdev);
> rtw_send_rsvd_page_h2c(rtwdev);
I think the download here has a different consequence after a switch
than in an ordinary beacon update. mac80211 has already changed the
channel. If building the page fails, the new beacon never reaches the
firmware, but mac80211 reports completion and the countdown work stops.
Could this path retry the new beacon when the download fails?
[ ... ]
> + if (conf->csa_active)
> + rtw_fw_csa_start(rtwdev, vif, !!ret);
This also makes the mac80211 IBSS fix a dependency. The cover
letter says it was in the test tree, but this rtw-next range is missing
12f97c692dcb. Leaving an IBSS clears the driver work and leaves
csa_active set. On the next join, this starts work on the new beacon,
which has no countdown and starts with a zero counter.
Could we make sure the mac80211 fix is in the target tree before
enabling CSA here?
https://lore.kernel.org/linux-wireless/20261025193615.1123718-1-mehmet.fide@gmail.com/
[ ... ]
> + } else {
> + rtw_fw_download_rsvd_page(rtwdev);
> + rtw_send_rsvd_page_h2c(rtwdev);
> + }
If the station's association download was deferred and the AP stops
before the next countdown download, this is the first attempt to update
the station's templates. The builder replaces the AP beacon with a
dummy page and recalculates the station page locations before it
allocates the download buffer. If that allocation fails and the AP
beacon used more than one page, the H2C can advertise new locations
while the firmware still has the old layout.
Could we send the locations only after a successful download and
retry the download if it fails?
[ ... ]
> + WIPHY_FLAG_HAS_CHANNEL_SWITCH;
What happens if the AP on an RTL8822C changes channel while the station
interface is associated on the old channel? So if I read it right,
mac80211 reserves a replacement for the shared context and the
combination check accepts it. At the end of the countdown, the old
context still has a station that did not reserve the new one, so
ieee80211_vif_use_reserved_switch() fails and mac80211 requests an AP
stop.
Could the driver reject this before it starts announcing the switch?
Best regards,
Luka Gejak
next prev parent reply other threads:[~2026-11-24 0:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 19:36 [PATCH rtw-next v14 0/3] wifi: rtw88: channel switch in AP mode Mehmet Fide
2026-11-21 19:36 ` [PATCH rtw-next v14 1/3] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
2026-11-21 19:36 ` [PATCH rtw-next v14 2/3] wifi: rtw88: support channel switch in AP mode Mehmet Fide
2026-11-24 0:24 ` Luka Gejak [this message]
2026-11-21 19:36 ` [PATCH rtw-next v14 3/3] wifi: rtw88: time the countdown downloads from the TBTT Mehmet Fide
2026-11-24 0:24 ` 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=20261124002437.213112-1-luka.gejak@linux.dev \
--to=luka.gejak@linux.dev \
--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=rtl8821cerfe2@gmail.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