From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <owen.hsiao@realtek.com>, <echuang@realtek.com>,
<henchy.chen@realtek.com>, <phhuang@realtek.com>,
<kevin_yang@realtek.com>
Subject: [PATCH rtw-next 13/14] wifi: rtw89: skip tracking things when entity is paused
Date: Wed, 26 Aug 2026 14:41:00 +0800 [thread overview]
Message-ID: <20260826064101.58892-14-pkshih@realtek.com> (raw)
In-Reply-To: <20260826064101.58892-1-pkshih@realtek.com>
From: Zong-Zhe Yang <kevin_yang@realtek.com>
In some situation, such as HW scan/ROC, entity will temporarily be paused.
They usually have special handling on chanctx. However, things in tracking
work focus on the operating channel. It would be better not to count these
temporary periods. So, add a check before doing tracking things. Also, LPS
will be expected to be off before pausing entity and during the period when
entity is paused.
Besides, since the flow where to call rtw89_recalc_lps() is based on iface
adding/removing, disabling has no need to depend on whether entity mode has
became MCC. Before MCC starts, there must be at least two ifaces first. If
two ifaces exist, rtw89_recalc_lps() will have already disabled LPS.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/chan.c | 12 ++++++++++++
drivers/net/wireless/realtek/rtw89/chan.h | 1 +
drivers/net/wireless/realtek/rtw89/core.c | 6 ++++++
drivers/net/wireless/realtek/rtw89/ps.c | 6 ------
4 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/chan.c b/drivers/net/wireless/realtek/rtw89/chan.c
index 7205fca8ac1a..a7ba47bd9abd 100644
--- a/drivers/net/wireless/realtek/rtw89/chan.c
+++ b/drivers/net/wireless/realtek/rtw89/chan.c
@@ -3230,6 +3230,9 @@ void rtw89_chanctx_pause(struct rtw89_dev *rtwdev,
lockdep_assert_wiphy(rtwdev->hw->wiphy);
+ if (test_bit(RTW89_FLAG_LEISURE_PS, rtwdev->flags))
+ rtw89_warn(rtwdev, "LPS isn't off when pausing chanctx\n");
+
if (hal->entity_pause)
return;
@@ -3247,6 +3250,15 @@ void rtw89_chanctx_pause(struct rtw89_dev *rtwdev,
hal->entity_pause = true;
}
+bool rtw89_chanctx_paused(struct rtw89_dev *rtwdev)
+{
+ struct rtw89_hal *hal = &rtwdev->hal;
+
+ lockdep_assert_wiphy(rtwdev->hw->wiphy);
+
+ return hal->entity_pause;
+}
+
static void rtw89_chanctx_proceed_cb(struct rtw89_dev *rtwdev,
const struct rtw89_chanctx_cb_parm *parm)
{
diff --git a/drivers/net/wireless/realtek/rtw89/chan.h b/drivers/net/wireless/realtek/rtw89/chan.h
index a9a5f1b307a2..f99aca9ef6a4 100644
--- a/drivers/net/wireless/realtek/rtw89/chan.h
+++ b/drivers/net/wireless/realtek/rtw89/chan.h
@@ -185,6 +185,7 @@ void rtw89_query_mr_chanctx_info(struct rtw89_dev *rtwdev, u8 inst_idx,
void rtw89_chanctx_track(struct rtw89_dev *rtwdev);
void rtw89_chanctx_pause(struct rtw89_dev *rtwdev,
const struct rtw89_chanctx_pause_parm *parm);
+bool __must_check rtw89_chanctx_paused(struct rtw89_dev *rtwdev);
void rtw89_chanctx_proceed(struct rtw89_dev *rtwdev,
const struct rtw89_chanctx_cb_parm *cb_parm);
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 24275c2250e7..80c4877e2dab 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -5496,6 +5496,9 @@ static void rtw89_track_ps_work(struct wiphy *wiphy, struct wiphy_work *work)
if (rtwdev->scanning)
return;
+ if (rtw89_chanctx_paused(rtwdev))
+ return;
+
if (rtwdev->lps_enabled && !rtwdev->btc.btc_ctrl_lps)
rtw89_enter_lps_track(rtwdev, RTW89_TFC_INTERVAL_100MS);
}
@@ -5521,6 +5524,9 @@ static void rtw89_track_work(struct wiphy *wiphy, struct wiphy_work *work)
if (rtwdev->scanning)
return;
+ if (rtw89_chanctx_paused(rtwdev))
+ return;
+
rtw89_leave_lps(rtwdev);
if (tfc_changed) {
diff --git a/drivers/net/wireless/realtek/rtw89/ps.c b/drivers/net/wireless/realtek/rtw89/ps.c
index 31bb5dcd284a..34105d030537 100644
--- a/drivers/net/wireless/realtek/rtw89/ps.c
+++ b/drivers/net/wireless/realtek/rtw89/ps.c
@@ -363,13 +363,8 @@ void rtw89_recalc_lps(struct rtw89_dev *rtwdev)
{
struct ieee80211_vif *vif, *found_vif = NULL;
struct rtw89_vif *rtwvif;
- enum rtw89_entity_mode mode;
int count = 0;
- mode = rtw89_get_entity_mode(rtwdev);
- if (mode == RTW89_ENTITY_MODE_MCC)
- goto disable_lps;
-
rtw89_for_each_rtwvif(rtwdev, rtwvif) {
vif = rtwvif_to_vif(rtwvif);
@@ -387,7 +382,6 @@ void rtw89_recalc_lps(struct rtw89_dev *rtwdev)
return;
}
-disable_lps:
rtw89_leave_lps(rtwdev);
rtwdev->lps_enabled = false;
}
--
2.25.1
next prev parent reply other threads:[~2026-08-26 6:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 6:40 [PATCH rtw-next 00/14] wifi: rtw89: update RTL8922D capabilities and settings, and enable P2P device Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 01/14] wifi: rtw89: 8922de: add low latency quirk for Valve device Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 02/14] wifi: rtw89: 8922d: disable VCORE for thermal protection by default Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 03/14] wifi: rtw89: allow two station interfaces in SCC Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 04/14] wifi: rtw89: 8922d: update BB wrapper RFSI ctrl to v4 Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 05/14] wifi: rtw89: 8922d: set BB wrapper settings according to operating channel Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 06/14] wifi: rtw89: 8922d: move conditionally disabled TX shape to common flow Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 07/14] wifi: rtw89: 8922d: update BB wrapper RFSI ctrl to v5 Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 08/14] wifi: rtw89: 8922d: send RFE type to firmware Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 09/14] wifi: rtw89: 8922d: bypass RX IQK when scan Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 10/14] wifi: rtw89: 8922d: correct selection of CCK rate circuit Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 11/14] wifi: rtw89: chan: introduce helper and refine active list iteration Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 12/14] wifi: rtw89: regd: check only active vifs when recalculating 6 GHz power type Ping-Ke Shih
2026-08-26 6:41 ` Ping-Ke Shih [this message]
2026-08-26 6:41 ` [PATCH rtw-next 14/14] wifi: rtw89: add p2p device declaration 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=20260826064101.58892-14-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=echuang@realtek.com \
--cc=henchy.chen@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=owen.hsiao@realtek.com \
--cc=phhuang@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.