From: Luka Gejak <luka.gejak@linux.dev>
To: Mehmet Fide <mehmet.fide@gmail.com>, Ping-Ke Shih <pkshih@realtek.com>
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
mehmet.fide@screeningeagle.com
Subject: Re: [PATCH rtw-next v10 3/3] wifi: rtw88: time the countdown downloads from the TBTT
Date: Thu, 12 Nov 2026 12:50:11 +0100 [thread overview]
Message-ID: <1D396970-35B7-4B0B-82E9-24B523AD69C2@linux.dev> (raw)
In-Reply-To: <20261111121525.358041-4-mehmet.fide@gmail.com>
Hi Mehmet,
Thanks for the v10. Two comments below.
On November 11, 2026 1:15:25 PM GMT+01:00, Mehmet Fide
<mehmet.fide@gmail.com> wrote:
> diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
> index 2d81aaeed0d7..c30aa938f9a9 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.c
> +++ b/drivers/net/wireless/realtek/rtw88/fw.c
[ ... ]
> +static void rtw_fw_csa_queue(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
> + bool start)
> {
> u32 interval = ieee80211_tu_to_usec(vif->bss_conf.beacon_int);
> + u64 tsf = rtw_fw_read_tsf(rtwdev);
As far as I can see rtw88 never writes the beacon interval register
(0x554), while rtlwifi writes it on BSS_CHANGED_BEACON_INT. So the
hardware probably keeps its default, and the TBTTs computed here from
bss_conf.beacon_int would only match the air at 100 TU.
Could you check the beacon spacing in a capture with beacon_int=200? If
it stays at 100 TU, that is a separate bug. Would you be willing to send
a fix for that too?
[ ... ]
> + delay = rtwdev->csa_tbtt + RTW_CSA_TBTT_MARGIN_US - tsf;
> + if (delay > interval + RTW_CSA_TBTT_MARGIN_US ||
> + delay < -(s64)interval) {
> + /* the TSF jumped: restart from the next TBTT */
> + div_u64_rem(tsf, interval, &rem);
> + rtwdev->csa_tbtt = tsf - rem + interval;
> + delay = rtwdev->csa_tbtt + RTW_CSA_TBTT_MARGIN_US - tsf;
> + }
rtw88 sets BIT_DIS_TSF_UDT for AP and IBSS and has no reset_tsf op, so I
think this mostly catches a download that ran more than a beacon
interval late, not a TSF jump. Maybe say that in the comment?
The start case computes the same next TBTT, so it could share this
branch:
rtwdev->csa_tbtt += interval;
delay = rtwdev->csa_tbtt + RTW_CSA_TBTT_MARGIN_US - tsf;
if (start || delay > interval + RTW_CSA_TBTT_MARGIN_US ||
delay < -(s64)interval) {
Best regards,
Luka Gejak
prev parent reply other threads:[~2026-11-12 11:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 12:15 [PATCH rtw-next v10 0/3] wifi: rtw88: channel switch in AP mode Mehmet Fide
2026-11-11 12:15 ` [PATCH rtw-next v10 1/3] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
2026-11-11 12:15 ` [PATCH rtw-next v10 2/3] wifi: rtw88: support channel switch in AP mode Mehmet Fide
2026-11-12 11:46 ` Luka Gejak
2026-11-11 12:15 ` [PATCH rtw-next v10 3/3] wifi: rtw88: time the countdown downloads from the TBTT Mehmet Fide
2026-11-12 11:50 ` Luka Gejak [this message]
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=1D396970-35B7-4B0B-82E9-24B523AD69C2@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