Re: [PATCH rtw-next v14 3/3] wifi: rtw88: time the countdown downloads from the TBTT

From: Luka Gejak

Date: Mon Nov 23 2026 - 19:25:37 EST


Hi Mehmet,

Thanks for trying the shorter margins. One comment below.

On November 21, 2026 8:36:44 PM GMT+01:00, Mehmet Fide
<mehmet.fide@xxxxxxxxx> wrote:

> + ieee80211_queue_delayed_work(rtwdev->hw,
> + &rtwdev->csa_beacon_work,
> + usecs_to_jiffies(hold));
> + goto out;

I think this can still miss several beacon intervals on a kernel with
HZ=100, even without a slow USB transfer. The timer wheel adds a tick
after usecs_to_jiffies() rounds the delay up. A hold of a few ms can
therefore move the work about 20 ms, which is close to the whole beacon
interval at 19 TU. The next run lands in almost the same part of the
interval and can defer again.

With a 19 TU interval and the TBTT and tick starting together, the
timer arithmetic allows consecutive steps at 200 and 550 ms, even
without transfer time or a late worker. A station that timed the switch
from an earlier count can then move several beacon intervals ahead of
the AP.

Could the wait for the safe part of the interval use a finer timer, or
could we limit CSA to intervals the timer can reliably handle?

Best regards,
Luka Gejak