Re: [PATCH rtw-next v9 3/3] wifi: rtw88: time the countdown downloads from the TBTT
From: Mehmet Fide
Date: Sat Oct 31 2026 - 17:21:47 EST
Hi Luka,
> Could the TSF also be read before rtw_fw_download_rsvd_page(), so that
> only a TBTT after the download started is taken as one that may have
> sent the first count?
You are right about the bug, but the TSF read before the download does
not cover all of it. The download is two writes, the whole reserved
page and then the beacon again, and both clear BIT_EN_BCN_FUNCTION.
Measured on an RTL8821CU with a sniffer, from a TSF read just before
the download:
- a TBTT before the first write (0.75 ms) sends the old beacon;
- from there to about 0.6 ms after the second write (2.9 ms), 82 of 89
TBTTs sent no beacon and 7 the old one;
- later TBTTs send the CSA beacon. v9 reads the TSF at 3.4 ms.
With a count of 5 and the TBTT forced into place:
- v9, TBTT 2 ms before the start: count 4 never went out (3 2 1 on
the air), 6 of 6;
- TSF read before the download, TBTT in the download: lost in 5 of 6;
- without the back-off, so that no earlier TBTT is taken as the one
that sent the first count: no count lost in 12 of 12, with the TBTT
before the start or in the download.
With a count of 2 in the v9 case, a Windows station re-associated after
each of 10 switches, and after none of 10 without the back-off.
So v10 drops the back-off. A TBTT in the last 0.5 ms before the TSF
read then sends the first count twice (4 4 3 2 1, 6 of 6 when forced
there), and the AP switches one beacon interval late; the Windows
station stayed associated in 8 of 8 such switches. A lost count is
worse: with a count of 2 no CSA beacon goes out at all. I will check it
on the 8822CE when it arrives.
Mehmet