Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <echuang@realtek.com>
Subject: [PATCH rtw-next] wifi: rtw89: 8922d: write path diff registers per PHY
Date: Tue, 24 Nov 2026 16:28:25 +0800	[thread overview]
Message-ID: <20261124082825.27916-1-pkshih@realtek.com> (raw)

From: Eric Huang <echuang@realtek.com>

The path diff tracking runs for each active PHY, but its registers are
written without a PHY index, so PHY1 results overwrite PHY0 and PHY1 is
never updated. Use rtw89_phy_write32_idx() instead.

Signed-off-by: Eric Huang <echuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/rtw8922d.c | 28 +++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922d.c b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
index 69eb1740ebf9..2c568bd67747 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922d.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
@@ -1857,23 +1857,23 @@ static void rtw8922d_path_diff_update(struct rtw89_dev *rtwdev,
 	else
 		ewma_path_diff_add(&bb->path_diff.avg, bb->path_diff.raw);
 
-	rtw89_phy_write32_mask(rtwdev, R_CL_MODE_TRIG_BE4, B_CL_MODE_TRIG_BE4, 1);
-	rtw89_phy_write32_mask(rtwdev, R_CL_MODE_TRIG_BE4, B_CL_MODE_TRIG_BE4, 0);
+	rtw89_phy_write32_idx(rtwdev, R_CL_MODE_TRIG_BE4, B_CL_MODE_TRIG_BE4, 1, phy_idx);
+	rtw89_phy_write32_idx(rtwdev, R_CL_MODE_TRIG_BE4, B_CL_MODE_TRIG_BE4, 0, phy_idx);
 
 	bf_smo_lmt = ewma_path_diff_read(&bb->path_diff.avg) < BF_SMOOTH_TH;
 	bb->path_diff.bf_smo_en = !bf_smo_lmt;
 
-	rtw89_phy_write32_mask(rtwdev, R_BF_SMO_PDP_LMT_EHT_BE4,
-			       B_BF_SMO_PDP_LMT_EHT_BE4, bf_smo_lmt);
-	rtw89_phy_write32_mask(rtwdev, R_BF_SMO_PDP_LMT_HE_BE4,
-			       B_BF_SMO_PDP_LMT_HE_BE4, bf_smo_lmt);
-	rtw89_phy_write32_mask(rtwdev, R_BF_SMO_PDP_LMT_VHT_BE4,
-			       B_BF_SMO_PDP_LMT_VHT_BE4, bf_smo_lmt);
+	rtw89_phy_write32_idx(rtwdev, R_BF_SMO_PDP_LMT_EHT_BE4,
+			      B_BF_SMO_PDP_LMT_EHT_BE4, bf_smo_lmt, phy_idx);
+	rtw89_phy_write32_idx(rtwdev, R_BF_SMO_PDP_LMT_HE_BE4,
+			      B_BF_SMO_PDP_LMT_HE_BE4, bf_smo_lmt, phy_idx);
+	rtw89_phy_write32_idx(rtwdev, R_BF_SMO_PDP_LMT_VHT_BE4,
+			      B_BF_SMO_PDP_LMT_VHT_BE4, bf_smo_lmt, phy_idx);
 
-	rtw89_phy_write32_mask(rtwdev, R_OS_TRIG_BY_SW_BE4,
-			       B_OS_TRIG_BY_SW_BE4, !bf_smo_lmt);
-	rtw89_phy_write32_mask(rtwdev, R_OS_TRIG_SOURCE_BE4,
-			       B_OS_TRIG_SOURCE_BE4, !bf_smo_lmt);
+	rtw89_phy_write32_idx(rtwdev, R_OS_TRIG_BY_SW_BE4,
+			      B_OS_TRIG_BY_SW_BE4, !bf_smo_lmt, phy_idx);
+	rtw89_phy_write32_idx(rtwdev, R_OS_TRIG_SOURCE_BE4,
+			      B_OS_TRIG_SOURCE_BE4, !bf_smo_lmt, phy_idx);
 
 	rtw89_entity_get_conf(rtwdev, &conf);
 	chan = conf.chans[phy_idx];
@@ -1882,8 +1882,8 @@ static void rtw8922d_path_diff_update(struct rtw89_dev *rtwdev,
 			sel_tone = he_eht_sel_tone[chan->band_width];
 		else if (bb->path_diff.link_mode == 1)
 			sel_tone = vht_sel_tone[chan->band_width];
-		rtw89_phy_write32_mask(rtwdev, R_SELECTED_TONE_IDX_BE4,
-				       B_SELECTED_TONE_IDX_BE4, sel_tone);
+		rtw89_phy_write32_idx(rtwdev, R_SELECTED_TONE_IDX_BE4,
+				      B_SELECTED_TONE_IDX_BE4, sel_tone, phy_idx);
 	}
 
 	rtw89_debug(rtwdev, RTW89_DBG_PHY_TRACK,

base-commit: 8b29fd95e2d3cb80564eb7cb34248b844422ba1e
-- 
2.53.0


                 reply	other threads:[~2026-11-24  8:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261124082825.27916-1-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=echuang@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    /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