From: Luka Gejak <luka.gejak@linux.dev>
To: Jie Feng <hjf3108@gmail.com>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
linux-wireless@vger.kernel.org,
Bitterblue Smith <rtl8821cerfe2@gmail.com>
Subject: Re: [PATCH rtw-next v5 6/7] wifi: rtw88: 88xxa: correct carrier-frequency offset
Date: Sat, 28 Nov 2026 16:42:57 +0100 [thread overview]
Message-ID: <68B406D1-643C-4CD1-AD77-70C665F3D509@linux.dev> (raw)
In-Reply-To: <CABOQOSVzi8rQk8GtKE9DL1GWz0VpEM3rfmDTpYy24HEyPGsG8g@mail.gmail.com>
On November 28, 2026 4:36:59 PM GMT+01:00, Jie Feng <hjf3108@gmail.com>
wrote:
>On Sat, 28 Nov 2026 at 19:29, Luka Gejak <luka.gejak@linux.dev> wrote:
>>
>> Hi Jie Feng,
>>
>> Thanks for the update. Two comments below.
>>
>> On November 28, 2026 2:00:26 AM GMT+08:00, Ho Jie Feng
>> <hjf3108@gmail.com> wrote:
>>
>> > - for (i = 0; i < rtwdev->hal.rf_path_num; i++) {
>> > + for (i = 0; i < path_num; i++) {
>> > cfo->cfo_tail[i] += pkt_stat->cfo_tail[i];
>> > cfo->cfo_cnt[i]++;
>> > }
>>
>> As far as I can see, RX can update these fields while the watchdog is
>> running rtw_phy_cfo_calc_avg(). It reads the sum and count separately,
>> then clears them in a second loop. A packet that arrives in between can
>> be counted against the wrong sum or cleared before it is used. That can
>> change the crystal adjustment even with a single peer.
>>
>> I think the same race exists on RTL8822C. Could we take and clear the
>> samples under the same lock as the RX updates before using the helper
>> on these chips?
>Yes, that makes sense. This could also be part of a CFO fixup patch
>series later? I don't want to unnecessarily bloat this patch series
>too much, and it currently doesn't change behaviour for RTL8822C.
Fine by me.
>
>> [ ... ]
>>
>> > + bool bt_hold = rtwdev->efuse.btcoex &&
>!rtw_coex_disabled(rtwdev);
>> > + u8 crystal_cap;
>> > +
>> > + crystal_cap = rtw_phy_cfo_xcap_track(rtwdev, RTW_XCAP_MASK,
>bt_hold);
>>
>> So if I read it right, the helper returns the current cap when no new
>> CFO samples have arrived, before checking bt_hold. If the RTL8821AU
>> already adjusted the cap, a firmware report that Bluetooth is active
>> can set bt_hold while WiFi is idle. The cap then stays adjusted until
>> another CFO sample arrives. On 2.4 GHz the AP may only be sending CCK
>> beacons in the meantime, which this path doesn't sample.
>>
>> Could the Bluetooth check restore the efuse value even when the sample
>> count has not changed?
>This is also an existing bug in RTL8822C, so same as the above?
>
That works for me.
Best regards,
Luka Gejak
next prev parent reply other threads:[~2026-11-28 15:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 18:00 [PATCH rtw-next v5 0/7] wifi: rtw88: extend 88xxA support Ho Jie Feng
2026-11-27 18:00 ` [PATCH rtw-next v5 1/7] wifi: rtw88: 8812a, 8814a: enable STBC for HT transmissions Ho Jie Feng
2026-11-28 15:43 ` Luka Gejak
2026-11-27 18:00 ` [PATCH rtw-next v5 2/7] wifi: rtw88: skip the dynamic CSI rate without a cfg_csi_rate op Ho Jie Feng
2026-11-28 15:43 ` Luka Gejak
2026-11-27 18:00 ` [PATCH rtw-next v5 3/7] wifi: rtw88: correctly expose beamformee capabilities Ho Jie Feng
2026-11-28 15:43 ` Luka Gejak
2026-11-27 18:00 ` [PATCH rtw-next v5 4/7] wifi: rtw88: 88xxa: receive VHT SU beamformed transmissions Ho Jie Feng
2026-11-28 15:44 ` Luka Gejak
2026-11-27 18:00 ` [PATCH rtw-next v5 5/7] wifi: rtw88: prepare frequency-offset correction for more chips Ho Jie Feng
2026-11-28 15:44 ` Luka Gejak
2026-11-27 18:00 ` [PATCH rtw-next v5 6/7] wifi: rtw88: 88xxa: correct carrier-frequency offset Ho Jie Feng
2026-11-28 11:29 ` Luka Gejak
2026-11-28 15:36 ` Jie Feng
2026-11-28 15:42 ` Luka Gejak [this message]
2026-11-28 15:44 ` Luka Gejak
2026-11-27 18:00 ` [PATCH rtw-next v5 7/7] wifi: rtw88: 8812a, 8821a: respect peer A-MPDU size limits Ho Jie Feng
2026-11-28 11:29 ` Luka Gejak
2026-11-28 15:37 ` Jie Feng
2026-11-28 15:44 ` Luka Gejak
2026-11-28 15:48 ` Jie Feng
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=68B406D1-643C-4CD1-AD77-70C665F3D509@linux.dev \
--to=luka.gejak@linux.dev \
--cc=hjf3108@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--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