Linux wireless drivers development
 help / color / mirror / Atom feed
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, linux-kernel@vger.kernel.org,
	"Bitterblue Smith" <rtl8821cerfe2@gmail.com>
Subject: Re: [PATCH rtw-next v4 6/7] wifi: rtw88: 88xxa: correct carrier-frequency offset
Date: Sat, 28 Nov 2026 10:54:06 +0000	[thread overview]
Message-ID: <64d36bd0ecc9447b616a4c8b55db121ea37b8f47@linux.dev> (raw)
In-Reply-To: <CABOQOSXgnFkSyL4hN9zDpq8iU24CFyS_yBS84Ts5QPzq9ntaxg@mail.gmail.com>

November 27, 2026 at 6:37 PM, "Jie Feng" <hjf3108@gmail.com> wrote:

> 
> Hi Luka,
> 
> On Sun, 15 Nov 2026 at 21:20, Luka Gejak <luka.gejak@linux.dev> wrote:
> 
> > 
> > Hi Jie Feng,
> > 
> >  Thanks for the patch. One comment below.
> > 
> >  On November 15, 2026 12:43:32 PM GMT+01:00, Ho Jie Feng <hjf3108@gmail.com>
> >  wrote:
> > 
> >  diff --git a/drivers/net/wireless/realtek/rtw88/rtw88xxa.c b/drivers/net/wireless/realtek/rtw88/rtw88xxa.c
> >  --- a/drivers/net/wireless/realtek/rtw88/rtw88xxa.c
> >  +++ b/drivers/net/wireless/realtek/rtw88/rtw88xxa.c
> > 
> >  [ ... ]
> > 
> >  @@ -1632,6 +1637,17 @@ void rtw88xxa_query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status,
> > 
> >  [ ... ]
> > 
> >  + rtw_phy_parsing_cfo(rtwdev, pkt_stat);
> > 
> >  [ ... ]
> > 
> >  @@ -2020,6 +2036,21 @@ void rtw88xxa_phy_pwrtrack(struct rtw_dev *rtwdev,
> > 
> >  [ ... ]
> > 
> >  + crystal_cap = rtw_phy_cfo_xcap_track(rtwdev, RTW_XCAP_MASK, bt_hold);
> >  + if (crystal_cap == cfo->crystal_cap)
> >  + return;
> >  +
> >  + cfo->crystal_cap = crystal_cap;
> >  + rtw88xxa_set_crystal_cap(rtwdev, crystal_cap);
> > 
> >  Could the shared helper discard the samples while sta_cnt != 1? In AP
> >  mode, frames from both clients match the interface BSSID, so these new
> >  calls keep adding their CFO samples. But rtw_phy_cfo_xcap_track() returns
> >  through rtw_phy_cfo_tracking_reset() before clearing the sums or counts.
> > 
> If there are multiple clients, an argument can be made that correcting
> the frequency so that it minimizes the frequency difference between
> the AP and the clients can improve performance. Taking the average of
> all the client offsets for the frames received might be good enough,
> since it gives an estimate of which client needs more attention and
> correct towards it. However, I feel like in this case, CFO tracking
> should be the responsibility of the client instead of the AP, since it
> can get all the devices to agree on the frequency.
> 

Makes sense.

> > 
> > So if I read it right, when one client leaves, the first adjustment still
> >  includes samples from that client. For example, on each reporting path,
> >  a +12 sample from the remaining client and a -48 sample from the other,
> >  followed by another +12, give an average of -20 kHz. The remaining client
> >  alone gives +30 kHz, so the first correction goes the wrong way.
> > 
> That does happen, although it might not be a big problem since as it
> gets more samples the CFO tracking should converge to the correct
> value.
> 
> > 
> > This was already present on 8822c, and this patch makes it reachable on
> >  88xxa too. I think the fix belongs in rtw_phy_cfo_xcap_track(), before
> >  these new callers start using it. Could the sums and counts be reset
> >  there when there is no single peer to track?
> > 
> Since this bug is pre-existing and not specific to 88xxa, I think it
> should be sent in as a separate patch?
> 

Yes.

> > 
> > Best regards,
> >  Luka Gejak
> >
>

  reply	other threads:[~2026-11-28 10:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 11:43 [PATCH rtw-next v4 0/7] wifi: rtw88: extend 88xxA support Ho Jie Feng
2026-11-15 11:43 ` [PATCH rtw-next v4 1/7] wifi: rtw88: 8812a, 8814a: enable STBC for HT transmissions Ho Jie Feng
2026-11-15 13:35   ` Luka Gejak
2026-11-16  6:54     ` Jie Feng
2026-11-16  8:06       ` Luka Gejak
2026-11-15 11:43 ` [PATCH rtw-next v4 2/7] wifi: rtw88: skip the dynamic CSI rate without a cfg_csi_rate op Ho Jie Feng
2026-11-15 11:43 ` [PATCH rtw-next v4 3/7] wifi: rtw88: correctly expose beamformee capabilities Ho Jie Feng
2026-11-15 13:20   ` Luka Gejak
2026-11-15 13:36   ` Luka Gejak
2026-11-15 13:37   ` Luka Gejak
2026-11-15 13:39     ` Luka Gejak
2026-11-15 11:43 ` [PATCH rtw-next v4 4/7] wifi: rtw88: 88xxa: receive VHT SU beamformed transmissions Ho Jie Feng
2026-11-15 11:43 ` [PATCH rtw-next v4 5/7] wifi: rtw88: prepare frequency-offset correction for more chips Ho Jie Feng
2026-11-15 13:41   ` Luka Gejak
2026-11-15 11:43 ` [PATCH rtw-next v4 6/7] wifi: rtw88: 88xxa: correct carrier-frequency offset Ho Jie Feng
2026-11-15 13:20   ` Luka Gejak
2026-11-27 17:37     ` Jie Feng
2026-11-28 10:54       ` Luka Gejak [this message]
2026-11-15 13:42   ` Luka Gejak
2026-11-15 11:43 ` [PATCH rtw-next v4 7/7] wifi: rtw88: 8812a, 8821a: respect peer A-MPDU size limits Ho Jie Feng
2026-11-15 13:43   ` 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=64d36bd0ecc9447b616a4c8b55db121ea37b8f47@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=hjf3108@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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