* [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
@ 2026-11-23 19:34 Josef Schlehofer
2026-11-27 7:06 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Josef Schlehofer @ 2026-11-23 19:34 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless, Bitterblue Smith
On RTL8922AU the channel calibration at AP start sometimes leaves path B
with a bad DPK result while the firmware reports success. The DPK TX AGC
of path B is then far below path A, or path B is not ok, and the AP
hardly gets frames to its clients until it is restarted. The TSSI and
IQK results of path B are off in the same runs.
Keep the DPK report the firmware sends and redo the whole channel
calibration when a path is not ok or timed out, or the TX AGC of the two
paths differs by more than 5, at most three times. The check runs only
when the PHY owns both paths.
Tested on RTL8922AU over USB in AP mode: 12 bad first calibrations in
145 AP starts, all good on the second try. No stall in 105 starts with
a client, against 4 of 80 without the patch.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
The check comes from one adapter. Is the DPK TX AGC gap, path_ok and
is_timeout the right thing to look at, or is there a better result the
driver should check? Or should the firmware handle this? The report is
kept in rfk_wait for now. Would rtwdev->dpk be better, like
rtwdev->iqk?
The older chips do it differently. RTL8852B runs DPK in the driver and
switches DPD off on a failed path, and rtw88 does the same on RTL8822C
after checking the coefficients. Neither redoes the calibration. Here
the firmware reports the bad path as ok in most runs, and TSSI and IQK
of that path are off as well, so this patch redoes the whole channel
calibration. Would switching DPD off on path B be preferred, at least
after the third bad try? The H2C has a dpk_enable byte, I did not try
it.
Details, RTL8922AU (Cudy BE6500), firmware 0.35.80.3, backports 7.2 on
Linux 6.18 (OpenWrt) unless noted:
- 5 to 15 percent of AP starts on channel 36 get the bad calibration,
the rate varies over time. Every one I tested with a client stalled
the AP (beacon loss on the client, a few Mbit/s). The rtw89 code of
early November (morrownr/rtw89 f2ce66e) behaves the same.
- With that morrownr build, which has diag_rf, running only the channel
calibration again fixed the same AP 3 of 3 times without a restart.
40 such runs in a row on a running AP (morrownr build on Turris OS)
were all good, so it seems to hit only the first calibration shortly
after the chip comes up. It also happens with the client powered off.
- Not the cause: skipping the PHY_1 channel setup in MLO 2+0 mode (5 of
40 starts still bad) and calling rfk_mlo_ctrl at the start of
rfk_init_late as RTL8922D does (4 of 40 still bad).
- The firmware sends the DPK report also with RFK debug off. All reports
I logged had is_timeout 0. RFK debug was on in all 145 starts of the
test line. With it off, earlier versions of this patch ran 40 starts
with a client without a stall, one of them with a visible retry.
- With RFK debug on, the DPK report came 0.01 to 0.04 ms after its RFK
state report in 34 runs over USB. The driver already waits for every
RFK state report on the one shared rfk_wait.completion, and the DPK
report relies on the same assumption.
- DPK TX AGC A/B (hex), good: 37/34, 36/34 and 36/33 on channel 36,
38/39, 38/35 and 38/36 on channel 149, 37/37 on 2.4 GHz channel 6.
Bad: path B at 28 to 30, or 00 with path_ok 0. The DPK correlation of
path B does not separate them (good 220 to 250, bad 166 to 241).
- Channel 149: no retry in 30 AP starts, but 3 of them had the TSSI
alignment of path B done and path B at 35 or 36 instead of 39. Traffic
on that channel is untested.
- No RFK step reported a failure in the 822 AP starts I have console
logs for, so the decision uses only the DPK report.
- Only the whole sequence was tested as the retry. Redoing only DPK is
untested. diag_rf records only the last try. The "no DPK report" path
and the "DPK still bad" warning never ran.
- Built and run only as a backport to 7.2. This rtw-next version was not
compiled.
- Tested only as an AP over USB with both antennas. Station mode, PCIe,
6 GHz, MLO, antenna masks and one-antenna boards are untested,
although the function runs there too.
- A missing report is accepted as before, so firmware without the report
and SER, where C2H events are not received, do not retry.
drivers/net/wireless/realtek/rtw89/core.c | 1 +
drivers/net/wireless/realtek/rtw89/core.h | 8 +++
drivers/net/wireless/realtek/rtw89/phy.c | 7 ++
drivers/net/wireless/realtek/rtw89/rtw8922a.c | 67 +++++++++++++++++--
4 files changed, 77 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 0f36185c19b..069bad16b78 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -7113,6 +7113,7 @@ int rtw89_core_init(struct rtw89_dev *rtwdev)
init_completion(&rtwdev->fw.req.completion);
init_completion(&rtwdev->rfk_wait.completion);
+ init_completion(&rtwdev->rfk_wait.dpk_rpt.done);
schedule_work(&rtwdev->load_firmware_work);
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index 87a832b5c29..f65b4ba7eba 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -6742,11 +6742,19 @@ struct rtw89_rfk_record {
enum rtw89_rfk_report_state states[NUM_OF_RTW89_RFK_REPORT_TYPES];
};
+struct rtw89_rfk_dpk_rpt {
+ struct completion done;
+ u8 path_ok[2];
+ u8 txagc[2];
+ u8 is_timeout[2];
+};
+
struct rtw89_rfk_wait_info {
struct completion completion;
ktime_t start_time;
enum rtw89_rfk_report_state state;
u8 version;
+ struct rtw89_rfk_dpk_rpt dpk_rpt;
int record_idx;
struct rtw89_rfk_record *record_ptr;
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index 9a7e032f7c8..0e6f36d4822 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -3563,6 +3563,7 @@ static void rtw89_phy_c2h_rfk_rpt_log(struct rtw89_dev *rtwdev,
struct rtw89_c2h_rf_dack_rpt_log *dack;
struct rtw89_c2h_rf_tssi_rpt_log *tssi;
struct rtw89_c2h_rf_dpk_rpt_log *dpk;
+ struct rtw89_rfk_dpk_rpt *dpk_rpt;
struct rtw89_c2h_rf_iqk_rpt_log *iqk;
int i, j, k;
@@ -3660,6 +3661,11 @@ static void rtw89_phy_c2h_rfk_rpt_log(struct rtw89_dev *rtwdev,
goto out;
dpk = content;
+ dpk_rpt = &rtwdev->rfk_wait.dpk_rpt;
+ memcpy(dpk_rpt->path_ok, dpk->path_ok, sizeof(dpk_rpt->path_ok));
+ memcpy(dpk_rpt->txagc, dpk->txagc, sizeof(dpk_rpt->txagc));
+ memcpy(dpk_rpt->is_timeout, dpk->is_timeout, sizeof(dpk_rpt->is_timeout));
+ complete(&dpk_rpt->done);
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"DPK ver:%d idx:%2ph band:%2ph bw:%2ph ch:%2ph path:%2ph\n",
dpk->ver, dpk->idx, dpk->band, dpk->bw, dpk->ch, dpk->path_ok);
@@ -4258,6 +4264,7 @@ int rtw89_phy_rfk_dpk_and_wait(struct rtw89_dev *rtwdev,
int ret;
rtw89_phy_rfk_report_prep(rtwdev);
+ reinit_completion(&rtwdev->rfk_wait.dpk_rpt.done);
ret = rtw89_fw_h2c_rf_dpk(rtwdev, phy_idx, chan);
if (ret)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922a.c b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
index 37eb5ed3659..cc384363a00 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922a.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
@@ -2385,6 +2385,47 @@ static void _wait_rx_mode(struct rtw89_dev *rtwdev, u8 kpath)
}
}
+#define RTW8922A_RFK_CHANNEL_TRIES 3
+#define RTW8922A_DPK_TXAGC_GAP_MAX 5
+#define RTW8922A_DPK_RPT_TIMEOUT_MS 20
+
+static bool rtw8922a_dpk_rpt_ok(struct rtw89_dev *rtwdev,
+ enum rtw89_phy_idx phy_idx, int try)
+{
+ struct rtw89_rfk_dpk_rpt *rpt = &rtwdev->rfk_wait.dpk_rpt;
+ unsigned long timeout = msecs_to_jiffies(RTW8922A_DPK_RPT_TIMEOUT_MS);
+ u8 path;
+
+ /* In MLO 1+1 mode each PHY owns one path, so there is nothing to
+ * compare.
+ */
+ if (rtw89_phy_get_kpath(rtwdev, phy_idx) != RF_AB)
+ return true;
+
+ /* Firmware without the report, and SER where C2H events are not
+ * received, keep the old behaviour without a retry.
+ */
+ if (!wait_for_completion_timeout(&rpt->done, timeout)) {
+ rtw89_debug(rtwdev, RTW89_DBG_RFK,
+ "[RFK] try %d: no DPK report\n", try);
+ return true;
+ }
+
+ for (path = RF_PATH_A; path <= RF_PATH_B; path++)
+ if (!rpt->path_ok[path] || rpt->is_timeout[path])
+ goto bad;
+
+ if (abs_diff(rpt->txagc[RF_PATH_A], rpt->txagc[RF_PATH_B]) <=
+ RTW8922A_DPK_TXAGC_GAP_MAX)
+ return true;
+
+bad:
+ rtw89_debug(rtwdev, RTW89_DBG_RFK,
+ "[RFK] try %d: DPK path_ok %2ph timeout %2ph txagc %2ph, redo\n",
+ try, rpt->path_ok, rpt->is_timeout, rpt->txagc);
+ return false;
+}
+
static void rtw8922a_rfk_channel(struct rtw89_dev *rtwdev,
struct rtw89_vif_link *rtwvif_link)
{
@@ -2393,17 +2434,31 @@ static void rtw8922a_rfk_channel(struct rtw89_dev *rtwdev,
enum rtw89_phy_idx phy_idx = rtwvif_link->phy_idx;
u8 phy_map = rtw89_btc_phymap(rtwdev, phy_idx, RF_AB, chanctx_idx);
u32 tx_en;
+ bool ok = false;
+ int try;
rtw89_btc_ntfy_wl_rfk(rtwdev, phy_map, BTC_WRFKT_CHLK, BTC_WRFK_START);
rtw89_chip_stop_sch_tx(rtwdev, phy_idx, &tx_en, RTW89_SCH_TX_SEL_ALL);
_wait_rx_mode(rtwdev, RF_AB);
- rtw89_phy_rfk_pre_ntfy_and_wait(rtwdev, phy_idx, 5);
- rtw89_phy_rfk_txgapk_and_wait(rtwdev, phy_idx, chan, 54);
- rtw89_phy_rfk_iqk_and_wait(rtwdev, phy_idx, chan, 84);
- rtw89_phy_rfk_tssi_and_wait(rtwdev, phy_idx, chan, RTW89_TSSI_NORMAL, 20);
- rtw89_phy_rfk_dpk_and_wait(rtwdev, phy_idx, chan, 34);
- rtw89_phy_rfk_rxdck_and_wait(rtwdev, RTW89_PHY_0, chan, true, 32);
+ /* A bad DPK comes with bad TSSI and IQK results of the same path,
+ * so redo the whole channel calibration, not only DPK.
+ */
+ for (try = 1; try <= RTW8922A_RFK_CHANNEL_TRIES; try++) {
+ rtw89_phy_rfk_pre_ntfy_and_wait(rtwdev, phy_idx, 5);
+ rtw89_phy_rfk_txgapk_and_wait(rtwdev, phy_idx, chan, 54);
+ rtw89_phy_rfk_iqk_and_wait(rtwdev, phy_idx, chan, 84);
+ rtw89_phy_rfk_tssi_and_wait(rtwdev, phy_idx, chan, RTW89_TSSI_NORMAL, 20);
+ rtw89_phy_rfk_dpk_and_wait(rtwdev, phy_idx, chan, 34);
+ ok = rtw8922a_dpk_rpt_ok(rtwdev, phy_idx, try);
+ rtw89_phy_rfk_rxdck_and_wait(rtwdev, RTW89_PHY_0, chan, true, 32);
+ if (ok)
+ break;
+ }
+
+ if (!ok)
+ rtw89_warn(rtwdev, "DPK still bad after %d tries\n",
+ RTW8922A_RFK_CHANNEL_TRIES);
rtw89_chip_resume_sch_tx(rtwdev, phy_idx, tx_en);
rtw89_btc_ntfy_wl_rfk(rtwdev, phy_map, BTC_WRFKT_CHLK, BTC_WRFK_STOP);
base-commit: 8b29fd95e2d3cb80564eb7cb34248b844422ba1e
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
2026-11-23 19:34 [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result Josef Schlehofer
@ 2026-11-27 7:06 ` Ping-Ke Shih
2026-11-29 9:17 ` Josef Schlehofer
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2026-11-27 7:06 UTC (permalink / raw)
To: Josef Schlehofer; +Cc: linux-wireless@vger.kernel.org, Bitterblue Smith
[-- Attachment #1: Type: text/plain, Size: 5106 bytes --]
Josef Schlehofer <pepe.schlehofer@gmail.com> wrote:
> On RTL8922AU the channel calibration at AP start sometimes leaves path B
> with a bad DPK result while the firmware reports success. The DPK TX AGC
> of path B is then far below path A, or path B is not ok, and the AP
> hardly gets frames to its clients until it is restarted. The TSSI and
> IQK results of path B are off in the same runs.
Can you try if any difference from attached newer firmware?
>
> Keep the DPK report the firmware sends and redo the whole channel
> calibration when a path is not ok or timed out, or the TX AGC of the two
> paths differs by more than 5, at most three times. The check runs only
> when the PHY owns both paths.
Is it necessary to redo whole calibration? Can it just redo DPK?
>
> Tested on RTL8922AU over USB in AP mode: 12 bad first calibrations in
> 145 AP starts, all good on the second try. No stall in 105 starts with
> a client, against 4 of 80 without the patch.
>
> Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
> ---
> The check comes from one adapter. Is the DPK TX AGC gap, path_ok and
> is_timeout the right thing to look at, or is there a better result the
> driver should check? Or should the firmware handle this?
Normally, we should check why the calibration fails instead of redo calibration.
> The report is
> kept in rfk_wait for now. Would rtwdev->dpk be better, like
> rtwdev->iqk?
It should be. But the struct is used by driver calibration for earlier chips.
>
> The older chips do it differently. RTL8852B runs DPK in the driver and
> switches DPD off on a failed path, and rtw88 does the same on RTL8822C
> after checking the coefficients. Neither redoes the calibration. Here
> the firmware reports the bad path as ok in most runs, and TSSI and IQK
> of that path are off as well, so this patch redoes the whole channel
> calibration. Would switching DPD off on path B be preferred, at least
> after the third bad try? The H2C has a dpk_enable byte, I did not try
> it.
I'm not sure. Let's try the latest firmware. If the symptom is still
existing, we can collect log for analysis.
[...]
> diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
> index 0f36185c19b..069bad16b78 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.c
> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> @@ -7113,6 +7113,7 @@ int rtw89_core_init(struct rtw89_dev *rtwdev)
>
> init_completion(&rtwdev->fw.req.completion);
> init_completion(&rtwdev->rfk_wait.completion);
> + init_completion(&rtwdev->rfk_wait.dpk_rpt.done);
>
> schedule_work(&rtwdev->load_firmware_work);
>
> diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
> index 87a832b5c29..f65b4ba7eba 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.h
> +++ b/drivers/net/wireless/realtek/rtw89/core.h
> @@ -6742,11 +6742,19 @@ struct rtw89_rfk_record {
> enum rtw89_rfk_report_state states[NUM_OF_RTW89_RFK_REPORT_TYPES];
> };
>
> +struct rtw89_rfk_dpk_rpt {
> + struct completion done;
> + u8 path_ok[2];
> + u8 txagc[2];
> + u8 is_timeout[2];
> +};
> +
> struct rtw89_rfk_wait_info {
> struct completion completion;
> ktime_t start_time;
> enum rtw89_rfk_report_state state;
> u8 version;
> + struct rtw89_rfk_dpk_rpt dpk_rpt;
>
> int record_idx;
> struct rtw89_rfk_record *record_ptr;
> diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
> index 9a7e032f7c8..0e6f36d4822 100644
> --- a/drivers/net/wireless/realtek/rtw89/phy.c
> +++ b/drivers/net/wireless/realtek/rtw89/phy.c
> @@ -3563,6 +3563,7 @@ static void rtw89_phy_c2h_rfk_rpt_log(struct rtw89_dev *rtwdev,
> struct rtw89_c2h_rf_dack_rpt_log *dack;
> struct rtw89_c2h_rf_tssi_rpt_log *tssi;
> struct rtw89_c2h_rf_dpk_rpt_log *dpk;
> + struct rtw89_rfk_dpk_rpt *dpk_rpt;
> struct rtw89_c2h_rf_iqk_rpt_log *iqk;
> int i, j, k;
>
> @@ -3660,6 +3661,11 @@ static void rtw89_phy_c2h_rfk_rpt_log(struct rtw89_dev *rtwdev,
> goto out;
>
> dpk = content;
> + dpk_rpt = &rtwdev->rfk_wait.dpk_rpt;
> + memcpy(dpk_rpt->path_ok, dpk->path_ok, sizeof(dpk_rpt->path_ok));
> + memcpy(dpk_rpt->txagc, dpk->txagc, sizeof(dpk_rpt->txagc));
> + memcpy(dpk_rpt->is_timeout, dpk->is_timeout, sizeof(dpk_rpt->is_timeout));
Prefer checking in-place, not store data.
Just record success or failure.
Reference to rtw89_wait_for_cond_prep().
> + complete(&dpk_rpt->done);
> rtw89_debug(rtwdev, RTW89_DBG_RFK,
> "DPK ver:%d idx:%2ph band:%2ph bw:%2ph ch:%2ph path:%2ph\n",
> dpk->ver, dpk->idx, dpk->band, dpk->bw, dpk->ch, dpk->path_ok);
[...]
pw-bot: cr
[-- Attachment #2: rtw8922a_fw-5.bin --]
[-- Type: application/octet-stream, Size: 2030562 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
2026-11-27 7:06 ` Ping-Ke Shih
@ 2026-11-29 9:17 ` Josef Schlehofer
2026-11-30 6:26 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Josef Schlehofer @ 2026-11-29 9:17 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless, Bitterblue Smith
Ping-Ke Shih <pkshih@realtek.com> wrote:
> Can you try if any difference from attached newer firmware?
Yes, and path B still comes out bad. With 40 AP starts per firmware,
0.35.80.3 gave 4 bad starts and 0.35.124.1 gave 3. I am sending you the
logs of three bad starts and one good start with 0.35.124.1 off-list.
The README in the archive says how they were made.
Your file is format 5, and I loaded it under the fw-4 name with
morrownr/rtw89, because the rtw89 in 7.2 lacks the firmware feature
checks for this version. Is that a valid test? The driver also drops the
DACK reports ("unexpected RFK func 2 report log with length 117"), maybe
for the same reason. Which debug mask would help you most?
> Is it necessary to redo whole calibration? Can it just redo DPK?
I have not tried redoing only DPK. A full channel RFK fixed every bad
start I retried so far. I can test DPK alone if you think it should be
enough.
I will take your code comments into v2 once we know which fix is right.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
2026-11-29 9:17 ` Josef Schlehofer
@ 2026-11-30 6:26 ` Ping-Ke Shih
2026-11-30 9:29 ` Josef Schlehofer
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2026-11-30 6:26 UTC (permalink / raw)
To: Josef Schlehofer; +Cc: linux-wireless@vger.kernel.org, Bitterblue Smith
Josef Schlehofer <pepe.schlehofer@gmail.com> wrote:
> Ping-Ke Shih <pkshih@realtek.com> wrote:
> > Can you try if any difference from attached newer firmware?
>
> Yes, and path B still comes out bad. With 40 AP starts per firmware,
> 0.35.80.3 gave 4 bad starts and 0.35.124.1 gave 3. I am sending you the
> logs of three bad starts and one good start with 0.35.124.1 off-list.
> The README in the archive says how they were made.
Thanks for the logs.
>
> Your file is format 5, and I loaded it under the fw-4 name with
> morrownr/rtw89, because the rtw89 in 7.2 lacks the firmware feature
> checks for this version. Is that a valid test?
Yes. It is okay.
> The driver also drops the
> DACK reports ("unexpected RFK func 2 report log with length 117"), maybe
> for the same reason. Which debug mask would help you most?
Currently, I only ask RTW89_DBG_RFK (you turn it on already).
Let RFK experts check the log to see if they need more.
>
> > Is it necessary to redo whole calibration? Can it just redo DPK?
>
> I have not tried redoing only DPK. A full channel RFK fixed every bad
> start I retried so far. I can test DPK alone if you think it should be
> enough.
>
> I will take your code comments into v2 once we know which fix is right.
We can wait a while for analysis.
By the way, can you try station mode to see if it has similar symptom?
Ping-Ke
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
2026-11-30 6:26 ` Ping-Ke Shih
@ 2026-11-30 9:29 ` Josef Schlehofer
2026-12-01 2:03 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Josef Schlehofer @ 2026-11-30 9:29 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless, Bitterblue Smith
Ping-Ke Shih <pkshih@realtek.com> wrote:
> By the way, can you try station mode to see if it has similar symptom?
On 5 GHz channel 36 in station mode, path B TXAGC was 0x33 or
0x34 in all 40 connection attempts. In AP mode during the same
boot, it was 0x33 or 0x34 in 31 of 40 start attempts, 0x29 in 7,
and 0x00 in 2. In the channel 36 station run the AP was a second
adapter a few centimetres away, and the AP run had no client. On
channel 149, path B TXAGC was 0x34 or higher in both station mode
and an earlier AP-mode run.
On 6 GHz channel 5 with 160 MHz bandwidth, in station mode
connected to a phone hotspot, path B TXAGC was 0x30 or 0x31 in
8 of 40 connection attempts and 0x39 or 0x34 in the other 32.
Those 8 connections still passed traffic during a brief test.
Before each connection attempt or AP start, I brought the radio
down and back up. This was the in-tree rtw89 driver in OpenWrt
main with firmware 0.35.80.3, not the morrownr driver from my
previous email. I can send the logs if your RFK experts would
like to take a look.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
2026-11-30 9:29 ` Josef Schlehofer
@ 2026-12-01 2:03 ` Ping-Ke Shih
2026-12-01 11:33 ` Josef Schlehofer
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2026-12-01 2:03 UTC (permalink / raw)
To: Josef Schlehofer; +Cc: linux-wireless@vger.kernel.org, Bitterblue Smith
Josef Schlehofer <pepe.schlehofer@gmail.com> wrote:
> Ping-Ke Shih <pkshih@realtek.com> wrote:
> > By the way, can you try station mode to see if it has similar symptom?
>
> On 5 GHz channel 36 in station mode, path B TXAGC was 0x33 or
> 0x34 in all 40 connection attempts. In AP mode during the same
> boot, it was 0x33 or 0x34 in 31 of 40 start attempts, 0x29 in 7,
> and 0x00 in 2. In the channel 36 station run the AP was a second
> adapter a few centimetres away, and the AP run had no client. On
> channel 149, path B TXAGC was 0x34 or higher in both station mode
> and an earlier AP-mode run.
Can I say
ch36 ch149
station mode good good
AP mode NG good
>
> On 6 GHz channel 5 with 160 MHz bandwidth, in station mode
> connected to a phone hotspot, path B TXAGC was 0x30 or 0x31 in
> 8 of 40 connection attempts and 0x39 or 0x34 in the other 32.
> Those 8 connections still passed traffic during a brief test.
And,
ch36 ch149 6GHz-ch5
station mode good good good
AP mode NG good
How about AP mode on 6GHz?
(I think it needs local patch; maybe you can try [1], but I still consider
the patchset)
[1] https://lore.kernel.org/linux-wireless/20261129120744.88178-1-pepe.schlehofer@gmail.com/
>
> Before each connection attempt or AP start, I brought the radio
> down and back up. This was the in-tree rtw89 driver in OpenWrt
> main with firmware 0.35.80.3, not the morrownr driver from my
> previous email. I can send the logs if your RFK experts would
> like to take a look.
They are still in discussion.
But, they asked me if I can reproduce the symptom you encountered, so
I plan to prepare the environment.
Could you share your hostpad configuration and the script to check
bad DPK? Then I can build the environment quickly.
I have only RTL8922AE (PCI) on my hand. So I'd want to know if you
tested RTL8922AE too? If not, I will try to borrow a RTL8922AU from
other team.
By your test results. It looks like station mode work well. I'm
thinking what they are different?
Ping-Ke
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result
2026-12-01 2:03 ` Ping-Ke Shih
@ 2026-12-01 11:33 ` Josef Schlehofer
0 siblings, 0 replies; 7+ messages in thread
From: Josef Schlehofer @ 2026-12-01 11:33 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless, Bitterblue Smith
Ping-Ke Shih <pkshih@realtek.com> wrote:
> And,
>
> ch36 ch149 6GHz-ch5
> station mode good good good
> AP mode NG good
>
> How about AP mode on 6GHz?
First a correction of my last mail. In the 6 GHz station run,
2 of the 8 low connections (both at 0x31) were dropped by the
hotspot 4 seconds after association with reason 15
(4WAY_HANDSHAKE_TIMEOUT). They reconnected with a new DPK result,
and my traffic test ran on that second connection. None of the
other 38 connections had this timeout.
I ran AP mode on 6 GHz channel 5 with 160 MHz bandwidth, with my
6 GHz AP series applied. In 79 starts over two boots, path B
TXAGC was 0x38 or 0x39 in 57, 0x34 or 0x36 in 16 and 0x31 or 0x32
in 6. Blocks on channel 36 between the 6 GHz blocks gave 0x32 to
0x34 in 103 of 120 starts and 0x30 or lower in 17.
To see which values matter, I kept single AP starts up and
connected a phone at -49 to -63 dBm. The test build needed commit
154d3668b64 ("wifi: rtw89: set RA init rate level when the
station RSSI is known") for this. Without it the TX rate often
stays at HE-MCS 2 and hides the difference. TX rate to the phone
under load:
ch 36 path B 0x33 HE-MCS 9, 80 MHz
ch 36 path B 0x2a HE-MCS 2, 40 MHz
6 GHz path B 0x39 HE-MCS 9 to 11 (2 starts)
6 GHz path B 0x35 HE-MCS 0
6 GHz path B 0x34 HE-MCS 1
6 GHz path B 0x32 HE-MCS 0 to 3
6 GHz path B 0x31 HE-MCS 0 to 4
A 1500 packet ping passed without loss in all of them, so only
the rate shows it. An rtw88 client on the 0x2a AP lost half of
its pings. On 6 GHz I tested 0x39 but not 0x38. These are single
starts with one phone.
Starts or connections with path B below the usual value (0x32 to
0x34 on channel 36, 0x38 or 0x39 on channel 149 and on 6 GHz):
ch 36 ch 149 6 GHz ch 5
station mode 0 of 40 4 of 40 12 of 40
AP mode 26 of 160 5 of 50 22 of 79
The AP numbers for channel 36 and 149 include my older runs. I
did not test channel 149 with a client. The check in my patch
(TX AGC difference above 5) would miss most of the low 6 GHz
starts, because path A is about 0x37 there.
> Could you share your hostpad configuration and the script to check
> bad DPK? Then I can build the environment quickly.
Both are at the end of this mail. The script restarts hostapd and
prints path A and B TXAGC from the DPK report of every start. It
only needs RTW89_DBG_RFK. Its LOW flag (path B below 0x32) is
meant for channel 36. I ran these two files here and 1 of
30 starts was low (0x2a). The rate changes a lot between runs, so
please give it 40 starts or more.
> I have only RTL8922AE (PCI) on my hand. So I'd want to know if you
> tested RTL8922AE too? If not, I will try to borrow a RTL8922AU from
> other team.
No, only USB. My adapter is a Cudy BE6500 (0bda:8912) in a USB 3
port. The driver prints "chip info CID: 71, CV: 1, AID: 6933,
ACV: 1, RFE: 1" for it.
> By your test results. It looks like station mode work well. I'm
> thinking what they are different?
I do not know. Both modes run the same rtw8922a_rfk_channel().
Station mode calls it from rtw89_core_sta_link_add() before
authentication. AP mode calls it from rtw89_ops_start_ap() after
rtw89_mac_port_update() and the role, join and CAM H2Cs. In both
modes the chip is powered on shortly before, and the DPK report
comes about 0.2 s (station) or 0.35 s (AP) after the last DACK.
On 6 GHz both modes are low about equally often.
I have the kernel log of every start if the RFK team wants them.
---- hostapd.conf ----
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=rtw89-test
country_code=CZ
ieee80211d=1
ieee80211h=1
hw_mode=a
channel=36
beacon_int=100
dtim_period=2
wmm_enabled=1
ieee80211n=1
ht_capab=[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][MAX-AMSDU-7935][DSSS_CCK-40][RX-STBC1]
ieee80211ac=1
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=42
vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][SU-BEAMFORMEE][MU-BEAMFORMEE][HTC-VHT][RX-STBC-1][BF-ANTENNA-4][MAX-MPDU-11454][MAX-A-MPDU-LEN-EXP7]
ieee80211ax=1
he_oper_chwidth=1
he_oper_centr_freq_seg0_idx=42
he_su_beamformee=1
wpa=2
wpa_key_mgmt=SAE
wpa_pairwise=CCMP
ieee80211w=2
sae_pwe=2
sae_password=CHANGEME
---- dpkloop.sh ----
#!/bin/sh
# dpkloop.sh IFACE HOSTAPD_CONF [N]
#
# Restart an rtw89 AP N times (default 40) with plain hostapd and print the
# firmware DPK report of every start. Needs root, hostapd, iw and a driver
# built with CONFIG_RTW89_DEBUGMSG. Only RTW89_DBG_RFK (0x2) is switched on.
#
# One line per start: <n> txagc A=<path A> B=<path B> dpk_ms=<n> [LOW]
# LOW marks a start with path B below 0x32. On 5 GHz channel 36 the normal
# value here is 0x33 or 0x34, the bad starts had 0x29 to 0x30 or 0x00.
IF=$1; CONF=$2; N=${3:-40}
[ -n "$IF" ] && [ -r "$CONF" ] || { echo "usage: $0 IFACE HOSTAPD_CONF [N]"; exit 1; }
MASK=/sys/module/rtw89_core/parameters/debug_mask
KM=/tmp/dpkloop.kmsg
PID=/tmp/dpkloop.pid
[ -w $MASK ] || { echo "$MASK missing, is rtw89 built with debug messages?"; exit 1; }
OLD=$(cat $MASK)
echo 0x2 > $MASK
: > $KM
cat /dev/kmsg >> $KM 2>/dev/null &
CAT=$!
stop_ap() { [ -f $PID ] && kill "$(cat $PID)" 2>/dev/null; rm -f $PID; }
trap 'stop_ap; kill $CAT 2>/dev/null; echo $OLD > $MASK' EXIT
trap 'exit 1' INT TERM
sleep 1
low=0; none=0; i=1
while [ $i -le $N ]; do
stop_ap
sleep 1
ip link set $IF down 2>/dev/null
sleep 3
: > $KM
hostapd -B -P $PID "$CONF" > /tmp/dpkloop.hostapd 2>&1 || { echo "$i hostapd failed, see /tmp/dpkloop.hostapd"; exit 1; }
j=0
while [ $j -lt 30 ] && ! grep -aq "DPK txagc:" $KM; do sleep 1; j=$((j + 1)); done
sleep 2
TX=$(grep -a "DPK txagc:" $KM | tail -1 | sed 's/.*DPK txagc:\(.. ..\).*/\1/')
MS=$(grep -a "RF DPK takes" $KM | tail -1 | sed 's/.*takes \([0-9]*\) ms.*/\1/')
if [ -z "$TX" ]; then
echo "$i no DPK report within 30 s"
none=$((none + 1))
else
A=${TX% *}; B=${TX#* }; FLAG=""
[ $((0x$B)) -lt $((0x32)) ] && { FLAG=" LOW"; low=$((low + 1)); cp $KM /tmp/dpkloop-$i.kmsg; }
echo "$i txagc A=$A B=$B dpk_ms=$MS$FLAG"
fi
i=$((i + 1))
done
echo "done: $low of $N starts with low path B, $none without a report, $(iw dev $IF info 2>/dev/null | grep channel | sed 's/^[ \t]*//')"
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-12-01 11:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 19:34 [PATCH rtw-next] wifi: rtw89: 8922a: redo channel RFK on a bad DPK result Josef Schlehofer
2026-11-27 7:06 ` Ping-Ke Shih
2026-11-29 9:17 ` Josef Schlehofer
2026-11-30 6:26 ` Ping-Ke Shih
2026-11-30 9:29 ` Josef Schlehofer
2026-12-01 2:03 ` Ping-Ke Shih
2026-12-01 11:33 ` Josef Schlehofer
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.