From: Ping-Ke Shih <pkshih@realtek.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"rtl8821cerfe2@gmail.com" <rtl8821cerfe2@gmail.com>
Cc: "Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
"s.l-h@gmx.de" <s.l-h@gmx.de>,
"chewitt@libreelec.tv" <chewitt@libreelec.tv>
Subject: Re: [PATCH v3 06/12] wifi: rtlwifi: Add rtl8192du/phy.{c,h}
Date: Wed, 27 Mar 2024 01:19:33 +0000 [thread overview]
Message-ID: <6348dcc1f8deb7eba6b97aec8ca6e629c70f4908.camel@realtek.com> (raw)
In-Reply-To: <387fa334-cc78-44fb-a638-0da9d104250c@gmail.com>
On Wed, 2024-03-27 at 00:13 +0200, Bitterblue Smith wrote:
>
> On 22/03/2024 07:22, Ping-Ke Shih wrote:
> > On Wed, 2024-03-20 at 21:38 +0200, Bitterblue Smith wrote:
> > [...]
> >
> > > +void rtl92d_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
> > > +{
> > > + struct rtl_priv *rtlpriv = rtl_priv(hw);
> > > + struct rtl_hal *rtlhal = &rtlpriv->rtlhal;
> > > + struct rtl_phy *rtlphy = &rtlpriv->phy;
> > > + u32 timeout = 2000, timecount = 0;
> > > +
> > > + while (rtlpriv->mac80211.act_scanning && timecount < timeout) {
> > > + udelay(50);
> > > + timecount += 50;
> >
> > What is the purpose?
> >
> > Even if you really need it, just mdelay(2) or something like that? >
>
> This comes from rtl8192de. The TX power tracking can re-do LC
> calibration. Someone decided that shouldn't happen while
> scanning. I don't know why.
I think you are right. While scanning, it will switch channels one by one,
but LC calibration is only for a certain channel (mostly operating channel),
so here is to wait for scanning completion with 2000 * 50us (100ms) timeout
to prevent interrupting LC calibration.
> > > + while (rtlphy->lck_inprogress && timecount < timeout) {
> > > + mdelay(50);
> > > + timecount += 50;
> > > + }
> >
> > Could LCK and switch channel happen simultaneously?
> > Can you point out the case?
> >
>
> When a scan coincides with the TX power tracking deciding to
> re-do LC calibration, I guess.
You are also right here. After looking deeper, TX power tracking and scan
are running on different work queues, and seemingly it would cause possibly
race condition, which possibly gets lower RF performance.
next prev parent reply other threads:[~2024-03-27 1:20 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 19:32 [PATCH v3 00/12] wifi: rtlwifi: Add new rtl8192du driver Bitterblue Smith
2024-03-20 19:33 ` [PATCH v3 01/12] wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power Bitterblue Smith
2024-03-22 1:25 ` Ping-Ke Shih
2024-03-20 19:34 ` [PATCH v3 02/12] wifi: rtlwifi: Move code from rtl8192de to rtl8192d-common Bitterblue Smith
2024-03-22 2:14 ` Ping-Ke Shih
2024-03-26 13:02 ` Bitterblue Smith
2024-03-20 19:35 ` [PATCH v3 03/12] wifi: rtlwifi: Adjust rtl8192d-common for USB Bitterblue Smith
2024-03-22 3:41 ` Ping-Ke Shih
2024-03-20 19:36 ` [PATCH v3 04/12] wifi: rtlwifi: Add rtl8192du/table.{c,h} Bitterblue Smith
2024-03-22 3:46 ` Ping-Ke Shih
2024-03-26 17:30 ` Bitterblue Smith
2024-03-27 9:18 ` Kalle Valo
2024-03-27 9:30 ` Ping-Ke Shih
2024-03-27 12:36 ` Bitterblue Smith
2024-03-27 12:42 ` Ping-Ke Shih
2024-03-27 12:53 ` Kalle Valo
2024-03-27 16:34 ` Jeff Johnson
2024-03-20 19:37 ` [PATCH v3 05/12] wifi: rtlwifi: Add rtl8192du/hw.{c,h} Bitterblue Smith
2024-03-22 4:02 ` Ping-Ke Shih
2024-03-20 19:38 ` [PATCH v3 06/12] wifi: rtlwifi: Add rtl8192du/phy.{c,h} Bitterblue Smith
2024-03-22 5:22 ` Ping-Ke Shih
2024-03-26 22:13 ` Bitterblue Smith
2024-03-27 1:19 ` Ping-Ke Shih [this message]
2024-03-20 19:39 ` [PATCH v3 07/12] wifi: rtlwifi: Add rtl8192du/trx.{c,h} Bitterblue Smith
2024-03-22 5:32 ` Ping-Ke Shih
2024-03-20 19:40 ` [PATCH v3 08/12] wifi: rtlwifi: Add rtl8192du/rf.{c,h} Bitterblue Smith
2024-03-22 5:35 ` Ping-Ke Shih
2024-03-20 19:41 ` [PATCH v3 09/12] wifi: rtlwifi: Add rtl8192du/fw.{c,h} and rtl8192du/led.{c,h} Bitterblue Smith
2024-03-22 5:42 ` Ping-Ke Shih
2024-03-20 19:42 ` [PATCH v3 10/12] wifi: rtlwifi: Add rtl8192du/dm.{c,h} Bitterblue Smith
2024-03-22 5:48 ` Ping-Ke Shih
2024-03-20 19:43 ` [PATCH v3 11/12] wifi: rtlwifi: Add rtl8192du/sw.{c,h} Bitterblue Smith
2024-03-22 6:04 ` Ping-Ke Shih
2024-03-27 14:07 ` Bitterblue Smith
2024-03-27 18:48 ` Kalle Valo
2024-03-27 22:53 ` Bitterblue Smith
2024-03-28 1:46 ` Ping-Ke Shih
2024-03-28 13:31 ` Bitterblue Smith
2024-03-29 0:34 ` Ping-Ke Shih
2024-03-31 18:48 ` Bitterblue Smith
2024-04-01 1:21 ` Ping-Ke Shih
2024-04-07 12:03 ` Bitterblue Smith
2024-04-08 2:45 ` Ping-Ke Shih
2024-04-08 9:01 ` Bitterblue Smith
2024-04-09 0:27 ` Ping-Ke Shih
2024-04-09 11:16 ` Bitterblue Smith
2024-03-28 1:49 ` Ping-Ke Shih
2024-03-20 19:44 ` [PATCH v3 12/12] wifi: rtlwifi: Enable the new rtl8192du driver Bitterblue Smith
2024-03-22 6:06 ` Ping-Ke Shih
2024-03-21 1:10 ` [PATCH v3 00/12] wifi: rtlwifi: Add " Stefan Lippers-Hollmann
2024-03-22 6:13 ` [PATCH v3 01/12] wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power Ping-Ke Shih
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=6348dcc1f8deb7eba6b97aec8ca6e629c70f4908.camel@realtek.com \
--to=pkshih@realtek.com \
--cc=Larry.Finger@lwfinger.net \
--cc=chewitt@libreelec.tv \
--cc=linux-wireless@vger.kernel.org \
--cc=rtl8821cerfe2@gmail.com \
--cc=s.l-h@gmx.de \
/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;
as well as URLs for NNTP newsgroup(s).