Skip to contentSkip to conversation

wifi: rtw89: add regulatory domain learning by firmware

PATCH In review Ping-Ke Shih 1 participant 4 messages Nov 4 – Nov 12 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

v4 cover wifi: rtw89: add regulatory domain learning by firmware

The regulatory learning is added to determine operating domain by firmware. With determined regulatory, it will change to a non-worldwide and become possible to access specific channels such as 6GHz channels to get better user experience.

v4:
- check list empty of active_list of chan_ctx to trigger learning.

v3:
- return -EAGAIN to scan request while learning is ongoing

v2:
- update backoff time to prevent busy retry for the environment where AP doesn't advertise country IE.

Johnson Tsai (1):
wifi: rtw89: add firmware-assisted regulatory domain learning

Zong-Zhe Yang (1):
wifi: rtw89: debug: support to disable regd learn

 drivers/net/wireless/realtek/rtw89/chan.h     |   1 +
 drivers/net/wireless/realtek/rtw89/core.c     |  12 +
 drivers/net/wireless/realtek/rtw89/core.h     |  22 ++
 drivers/net/wireless/realtek/rtw89/debug.c    |   1 +
 drivers/net/wireless/realtek/rtw89/fw.c       |  43 +++
 drivers/net/wireless/realtek/rtw89/fw.h       |  29 ++
 drivers/net/wireless/realtek/rtw89/mac.c      |  69 +++++
 drivers/net/wireless/realtek/rtw89/mac.h      |   1 +
 drivers/net/wireless/realtek/rtw89/mac80211.c |  28 +-
 drivers/net/wireless/realtek/rtw89/pci.c      |   1 +
 drivers/net/wireless/realtek/rtw89/ps.h       |   5 +-
 drivers/net/wireless/realtek/rtw89/regd.c     | 262 ++++++++++++++++++
 drivers/net/wireless/realtek/rtw89/ser.c      |   1 +
 drivers/net/wireless/realtek/rtw89/util.h     |   8 +
 14 files changed, 479 insertions(+), 4 deletions(-)

base-commit: dc16902cad9c6b08df9395a510c7be44fbab545d

Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v4 1/2 wifi: rtw89: add firmware-assisted regulatory domain learning

From: Johnson Tsai <[email protected]>

Introduce a FW feature for regulatory domain learning, and add flow to maintain the lifecycle of the FW process. With the FW feature supported, FW can attempt to detect the most likely regulatory domain according to surrounding APs. This FW feature will only be activated when there is no active chanctx, and its regdom result can be replaced by another request with higher priority.

Now, the priority order of various regdom requests is as follows.
1. programmed in module
2. set by distro/user
3. set by country IE
4. FW regd learn

Besides, the FW process of this FW feature will be canceled immediately once a distro/user regdom request or any non-WW regdom request arrives. Then, this FW feature will no longer run until a WW regdom request comes even if it's in the range where it can be activated.

One difference from before is that once a regdom result is obtained from this FW feature, there will be a wiphy regd, e.g. iw reg get will show regdom by phy instead of only global regdom. But, the wiphy regd will be updated as appropriate as possible.

---
v4:
- check list empty of active_list of chan_ctx to trigger learning.
v3:
- return -EAGAIN to scan request while learning is ongoing
v2:
- update backoff time to prevent busy retry for the environment where AP doesn't advertise country IE.

---
 drivers/net/wireless/realtek/rtw89/chan.h     |   1 +
 drivers/net/wireless/realtek/rtw89/core.c     |   4 +
 drivers/net/wireless/realtek/rtw89/core.h     |  21 ++
 drivers/net/wireless/realtek/rtw89/fw.c       |  43 +++
 drivers/net/wireless/realtek/rtw89/fw.h       |  29 ++
 drivers/net/wireless/realtek/rtw89/mac.c      |  69 +++++
 drivers/net/wireless/realtek/rtw89/mac.h      |   1 +
 drivers/net/wireless/realtek/rtw89/mac80211.c |  28 +-
 drivers/net/wireless/realtek/rtw89/pci.c      |   1 +
 drivers/net/wireless/realtek/rtw89/ps.h       |   5 +-
 drivers/net/wireless/realtek/rtw89/regd.c     | 258 ++++++++++++++++++
 drivers/net/wireless/realtek/rtw89/ser.c      |   1 +
 drivers/net/wireless/realtek/rtw89/util.h     |   8 +
 13 files changed, 465 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/chan.h +1 -0
index f99aca9ef6a4..e9df90c4ce3c 100644
@@ -97,6 +97,7 @@ enum rtw89_chanctx_pause_reasons {
 	RTW89_CHANCTX_PAUSE_REASON_HW_SCAN,
 	RTW89_CHANCTX_PAUSE_REASON_ROC,
 	RTW89_CHANCTX_PAUSE_REASON_GC_BCN_LOSS,
+	RTW89_CHANCTX_PAUSE_REASON_REGD_LEARN,
 };
 
 struct rtw89_chanctx_pause_parm {
drivers/net/wireless/realtek/rtw89/core.c +4 -0
index 58ee5efc3b5e..8c4dd6f4a797 100644
@@ -5026,6 +5026,8 @@ void rtw89_roc_start(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
 
 	lockdep_assert_wiphy(hw->wiphy);
 
+	rtw89_regd_learn_cancel(rtwdev);
+
 	rtw89_leave_ips_by_hwflags(rtwdev);
 	rtw89_leave_lps(rtwdev);
 
@@ -5115,6 +5117,8 @@ void rtw89_roc_end(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
 		wiphy_delayed_work_queue(hw->wiphy, &roc->roc_work,
 					 msecs_to_jiffies(RTW89_ROC_IDLE_TIMEOUT));
+
+	rtw89_regd_learn_queue(rtwdev);
 }
 
 void rtw89_roc_work(struct wiphy *wiphy, struct wiphy_work *work)
drivers/net/wireless/realtek/rtw89/core.h +21 -0
index 0d893b992a4a..d0a42f09fa13 100644
@@ -6126,6 +6126,7 @@ enum rtw89_fw_feature {
 	RTW89_FW_FEATURE_SER_POST_RECOVER_DMAC,
 	RTW89_FW_FEATURE_TX_HISTORY_V1,
 	RTW89_FW_FEATURE_NO_DRV_BT_TXRX_EN,
+	RTW89_FW_FEATURE_REGD_LEARN,
 
 	NUM_OF_RTW89_FW_FEATURES,
 };
@@ -6564,6 +6565,7 @@ enum rtw89_flags {
 	RTW89_FLAG_HW_RFKILL_STATE,
 	RTW89_FLAG_UNPLUGGED,
 	RTW89_FLAG_SHUTDOWN,
+	RTW89_FLAG_REGD_LEARNING,
 
 	NUM_OF_RTW89_FLAGS,
 };
@@ -7098,6 +7100,19 @@ struct rtw89_regd_ctrl {
 	const struct rtw89_regd *map;
 };
 
+#define RTW89_REGD_LEARN_TIMEOUT 8
+#define RTW89_REGD_LEARN_CACHE_TTL 3600
+
+struct rtw89_regd_learn {
+	char hinted_alpha2[2];
+	bool can_activate;
+	bool shall_run;
+	unsigned long last_hint;
+	unsigned int retry;
+	struct wiphy_delayed_work work;
+	struct wiphy_delayed_work timeout_work;
+};
+
 #define RTW89_REGD_MAX_COUNTRY_NUM U8_MAX
 #define RTW89_5GHZ_UNII4_CHANNEL_NUM 3
 #define RTW89_5GHZ_UNII4_START_INDEX 25
@@ -7796,6 +7811,7 @@ struct rtw89_dev {
 	bool scanning;
 
 	struct rtw89_regulatory_info regulatory;
+	struct rtw89_regd_learn regd_learn;
 	struct rtw89_sar_info sar;
 	struct rtw89_tas_info tas;
 	struct rtw89_ant_gain_info ant_gain;
@@ -9540,6 +9556,11 @@ bool rtw89_legacy_rate_to_bitrate(struct rtw89_dev *rtwdev, u8 legacy_rate, u16
 int rtw89_regd_setup(struct rtw89_dev *rtwdev);
 int rtw89_regd_init_hint(struct rtw89_dev *rtwdev);
 const char *rtw89_regd_get_string(enum rtw89_regulation_type regd);
+void rtw89_regd_learn_init(struct rtw89_dev *rtwdev);
+void rtw89_regd_learn_deinit(struct rtw89_dev *rtwdev, bool ser);
+void rtw89_regd_learn_queue(struct rtw89_dev *rtwdev);
+void rtw89_regd_learn_cancel(struct rtw89_dev *rtwdev);
+void rtw89_regd_learn_update(struct rtw89_dev *rtwdev, const char *alpha2, bool sync);
 void rtw89_traffic_stats_init(struct rtw89_dev *rtwdev,
 			      struct rtw89_traffic_stats *stats);
 struct rtw89_wait_response *
drivers/net/wireless/realtek/rtw89/fw.c +43 -0

61 lines not on this page · raw message

drivers/net/wireless/realtek/rtw89/fw.h +29 -0
index e4d3331fc18f..50b813a3eed4 100644
@@ -4000,6 +4000,7 @@ struct rtw89_fw_c2h_attr {
 	u8 class;
 	u8 func;
 	u16 len;
+	u8 ignore: 1;
 	u8 is_scan_event: 1;
 	u8 scan_seq: 2;
 };
@@ -4179,6 +4180,22 @@ struct rtw89_c2h_scanofld {
 #define RTW89_C2H_SCANOFLD_W8_PERIOD_V1 GENMASK(15, 0)
 #define RTW89_C2H_SCANOFLD_W8_EXPECT_PERIOD_V1 GENMASK(31, 16)
 
+struct rtw89_c2h_regd_learn {
+	struct rtw89_c2h_hdr hdr;
+	__le32 w2;
+} __packed;
+
+#define RTW89_C2H_REGD_LEARN_W2_STATUS GENMASK(7, 0)
+#define RTW89_C2H_REGD_LEARN_W2_COUNTRY_0 GENMASK(15, 8)
+#define RTW89_C2H_REGD_LEARN_W2_COUNTRY_1 GENMASK(23, 16)
+
+enum rtw89_c2h_regd_learn_status {
+	RTW89_C2H_REGD_LEARN_NONE = 0,
+	RTW89_C2H_REGD_LEARN_LEARNED = 1,
+	RTW89_C2H_REGD_LEARN_VERIFIED = 2,
+	RTW89_C2H_REGD_LEARN_ABORT = 3,
+};
+
 #define RTW89_GET_MAC_C2H_MCC_RCV_ACK_GROUP(c2h) \
 	le32_get_bits(*((const __le32 *)(c2h) + 2), GENMASK(1, 0))
 #define RTW89_GET_MAC_C2H_MCC_RCV_ACK_H2C_FUNC(c2h) \
@@ -4856,10 +4873,19 @@ enum rtw89_fw_ofld_h2c_func {
 	H2C_FUNC_MAC_MACID_PAUSE_SLEEP	= 0x28,
 	H2C_FUNC_SCANOFLD_BE		= 0x2c,
 	H2C_FUNC_TRX_PROTECT		= 0x34,
+	H2C_FUNC_REGD_LEARN		= 0x53,
 
 	NUM_OF_RTW89_FW_OFLD_H2C_FUNC,
 };
 
+struct rtw89_h2c_regd_learn {
+	__le32 w0;
+} __packed;
+
+#define RTW89_H2C_REGD_LEARN_W0_COUNTRY_0	GENMASK(7, 0)
+#define RTW89_H2C_REGD_LEARN_W0_COUNTRY_1	GENMASK(15, 8)
+#define RTW89_H2C_REGD_LEARN_W0_ABORT		BIT(16)
+
 #define RTW89_FW_OFLD_WAIT_COND(tag, func) \
 	((tag) * NUM_OF_RTW89_FW_OFLD_H2C_FUNC + (func))
 
@@ -4867,6 +4893,8 @@ enum rtw89_fw_ofld_h2c_func {
 	RTW89_FW_OFLD_WAIT_COND(RTW89_PKT_OFLD_WAIT_TAG(pkt_id, pkt_op), \
 				H2C_FUNC_PACKET_OFLD)
 #define RTW89_FW_OFLD_WAIT_COND_TRX_PROTECT RTW89_FW_OFLD_WAIT_COND(0, H2C_FUNC_TRX_PROTECT)
+#define RTW89_FW_OFLD_WAIT_COND_REGD_LEARN_ABORT \
+	RTW89_FW_OFLD_WAIT_COND(1, H2C_FUNC_REGD_LEARN)
 
 #define RTW89_SCANOFLD_WAIT_COND_ADD_CH RTW89_FW_OFLD_WAIT_COND(0, H2C_FUNC_ADD_SCANOFLD_CH)
 
@@ -5684,6 +5712,7 @@ int rtw89_hw_scan_append_wildcard_probe_req(struct rtw89_dev *rtwdev,
 					    const u8 *mac_addr, bool wowlan);
 void rtw89_hw_scan_calc_req_ssid(struct rtw89_dev *rtwdev,
 				 struct rtw89_vif_link *rtwvif_link, bool wowlan);
+int rtw89_fw_h2c_regd_learn(struct rtw89_dev *rtwdev, const char *dflt);
 int rtw89_fw_h2c_trigger_cpu_exception(struct rtw89_dev *rtwdev);
 int rtw89_fw_h2c_pkt_drop(struct rtw89_dev *rtwdev,
 			  const struct rtw89_pkt_drop_params *params);
drivers/net/wireless/realtek/rtw89/mac.c +69 -0

99 lines not on this page · raw message

drivers/net/wireless/realtek/rtw89/mac.h +1 -0
index 8419bcd3956a..db42e33e694c 100644
@@ -413,6 +413,7 @@ enum rtw89_mac_c2h_ofld_func {
 	RTW89_MAC_C2H_FUNC_SCANOFLD_RSP = 0x9,
 	RTW89_MAC_C2H_FUNC_TX_DUTY_RPT = 0xa,
 	RTW89_MAC_C2H_FUNC_BCNFLTR_RPT = 0xd,
+	RTW89_MAC_C2H_FUNC_REGD_LEARN = 0x24,
 	RTW89_MAC_C2H_FUNC_OFLD_MAX,
 };
 
drivers/net/wireless/realtek/rtw89/mac80211.c +26 -2
index 9e6cafc492c4..9134cdce2f47 100644
@@ -57,10 +57,17 @@ static void rtw89_ops_wake_tx_queue(struct ieee80211_hw *hw,
 static int rtw89_ops_start(struct ieee80211_hw *hw)
 {
 	struct rtw89_dev *rtwdev = hw->priv;
+	int ret;
 
 	lockdep_assert_wiphy(hw->wiphy);
 
-	return rtw89_core_start(rtwdev);
+	ret = rtw89_core_start(rtwdev);
+	if (ret)
+		return ret;
+
+	rtw89_regd_learn_init(rtwdev);
+
+	return 0;
 }
 
 static void rtw89_ops_stop(struct ieee80211_hw *hw, bool suspend)
@@ -69,6 +76,8 @@ static void rtw89_ops_stop(struct ieee80211_hw *hw, bool suspend)
 
 	lockdep_assert_wiphy(hw->wiphy);
 
+	rtw89_regd_learn_deinit(rtwdev, false);
+
 	rtw89_core_stop(rtwdev);
 }
 
@@ -95,7 +104,8 @@ static int rtw89_ops_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
 
 	if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
 	    (hw->conf.flags & IEEE80211_CONF_IDLE) &&
-	    !rtwdev->scanning)
+	    !rtwdev->scanning &&
+	    !test_bit(RTW89_FLAG_REGD_LEARNING, rtwdev->flags))
 		rtw89_enter_ips(rtwdev);
 
 	if (changed & IEEE80211_CONF_CHANGE_MONITOR)
@@ -1298,6 +1308,9 @@ static int rtw89_ops_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		return -EBUSY;
 	}
 
+	if (test_bit(RTW89_FLAG_REGD_LEARNING, rtwdev->flags))
+		return -EAGAIN;
+
 	if (rtwdev->scanning || rtwvif->offchan)
 		return -EBUSY;
 
@@ -1413,6 +1426,8 @@ static int rtw89_ops_assign_vif_chanctx(struct ieee80211_hw *hw,
 		return -ENOLINK;
 	}
 
+	rtw89_regd_learn_deinit(rtwdev, false);
+
 	return rtw89_chanctx_ops_assign_vif(rtwdev, rtwvif_link, ctx);
 }
 
@@ -1436,6 +1451,9 @@ static void rtw89_ops_unassign_vif_chanctx(struct ieee80211_hw *hw,
 	}
 
 	rtw89_chanctx_ops_unassign_vif(rtwdev, rtwvif_link, ctx);
+
+	if (rtw89_no_active_rtwvif(rtwdev))
+		rtw89_regd_learn_init(rtwdev);
 }
 
 static
@@ -1737,6 +1755,9 @@ int rtw89_ops_change_vif_links(struct ieee80211_hw *hw,
 		rcu_assign_pointer(rtwvif->snap_link_confs, snap);
 	}
 
+	/* might enter ips without defer work */
+	rtw89_regd_learn_cancel(rtwdev);
+
 	/* might depend on @snap; don't change order */
 	rtw89_leave_ips_by_hwflags(rtwdev);
 
@@ -1780,6 +1801,9 @@ int rtw89_ops_change_vif_links(struct ieee80211_hw *hw,
 		rtw89_vif_update_fw_links(rtwdev, rtwvif, new_links, false);
 
 	rtw89_enter_ips_by_hwflags(rtwdev);
+
+	rtw89_regd_learn_queue(rtwdev);
+
 	return ret;
 }
 
drivers/net/wireless/realtek/rtw89/pci.c +1 -0
index ddb27c7782a9..6d19e759fc0d 100644
@@ -4268,6 +4268,7 @@ static void rtw89_pci_recalc_int_mit(struct rtw89_dev *rtwdev)
 	u32 val = 0;
 
 	if (rtwdev->scanning ||
+	    test_bit(RTW89_FLAG_REGD_LEARNING, rtwdev->flags) ||
 	    (tx_tfc_lv < RTW89_TFC_HIGH && rx_tfc_lv < RTW89_TFC_HIGH))
 		goto out;
 
drivers/net/wireless/realtek/rtw89/ps.h +3 -2
index 729477153de6..dee4d25da8cd 100644
@@ -41,8 +41,9 @@ static inline void rtw89_enter_ips_by_hwflags(struct rtw89_dev *rtwdev)
 {
 	struct ieee80211_hw *hw = rtwdev->hw;
 
-	/* prevent entering IPS after ROC, but it is scanning */
-	if (rtwdev->scanning)
+	/* prevent entering IPS after ROC, but it is scanning or regd learning */
+	if (rtwdev->scanning ||
+	    test_bit(RTW89_FLAG_REGD_LEARNING, rtwdev->flags))
 		return;
 
 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
drivers/net/wireless/realtek/rtw89/regd.c +258 -0

283 lines not on this page · raw message

drivers/net/wireless/realtek/rtw89/ser.c +1 -0
index 045dac0bd1db..3dc1b8a8dc2b 100644
@@ -726,6 +726,7 @@ static void ser_l2_reset_st_pre_hdl(struct rtw89_ser *ser)
 bottom:
 	rtw89_ser_cd_free(rtwdev, buf, !!ret);
 
+	rtw89_regd_learn_deinit(rtwdev, true);
 	ser_reset_mac_binding(rtwdev);
 	rtw89_core_stop(rtwdev);
 	rtw89_entity_init(rtwdev);
drivers/net/wireless/realtek/rtw89/util.h +8 -0
index aa87a520bdc3..08a9b98786d1 100644
@@ -25,6 +25,14 @@
 #define rtw89_for_each_active_rtwvif(rtwdev, rtwvif) \
 	list_for_each_entry(rtwvif, &(rtwdev)->hal.entity_mgnt.active_list, mgnt_entry)
 
+static inline bool rtw89_no_active_rtwvif(struct rtw89_dev *rtwdev)
+{
+	struct rtw89_hal *hal = &rtwdev->hal;
+	struct rtw89_entity_mgnt *mgnt = &hal->entity_mgnt;
+
+	return list_empty(&mgnt->active_list);
+}
+
 /* Before adding rtwvif to list, we need to check if it already exist, beacase
  * in some case such as SER L2 happen during WoWLAN flow, calling reconfig
  * twice cause the list to be added twice.
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

Re: [PATCH rtw-next v4 1/2] wifi: rtw89: add firmware-assisted regulatory domain learning

Quoted 25 lines · Ping-Ke Shih

From: Johnson Tsai <[email protected]>

Introduce a FW feature for regulatory domain learning, and add flow to maintain the lifecycle of the FW process. With the FW feature supported, FW can attempt to detect the most likely regulatory domain according to surrounding APs. This FW feature will only be activated when there is no active chanctx, and its regdom result can be replaced by another request with higher priority.

Now, the priority order of various regdom requests is as follows.
1. programmed in module
2. set by distro/user
3. set by country IE
4. FW regd learn

Besides, the FW process of this FW feature will be canceled immediately once a distro/user regdom request or any non-WW regdom request arrives. Then, this FW feature will no longer run until a WW regdom request comes even if it's in the range where it can be activated.

One difference from before is that once a regdom result is obtained from this FW feature, there will be a wiphy regd, e.g. iw reg get will show regdom by phy instead of only global regdom. But, the wiphy regd will be updated as appropriate as possible.

Quoted 6 lines

2 patch(es) applied to rtw-next branch of rtw.git, thanks.

27c7643765e4 wifi: rtw89: add firmware-assisted regulatory domain learning 61a5eb87b2d9 wifi: rtw89: debug: support to disable regd learn

---
https://github.com/pkshih/rtw.git

author maintainer
#3 lore raw

PATCH v4 2/2 wifi: rtw89: debug: support to disable regd learn

In reply to Ping-Ke Shih

From: Zong-Zhe Yang <[email protected]>

Set BIT(RTW89_DM_REGD_LEARN) to dbgfs disable_dm if needing to disable regd learn mechanism at runtime. Read dbgfs disable_dm to show current status.

---
v4: no change
v3: no change
v2: no change

---
 drivers/net/wireless/realtek/rtw89/core.c  | 8 ++++++++
 drivers/net/wireless/realtek/rtw89/core.h  | 1 +
 drivers/net/wireless/realtek/rtw89/debug.c | 1 +
 drivers/net/wireless/realtek/rtw89/regd.c  | 4 ++++
 4 files changed, 14 insertions(+)
drivers/net/wireless/realtek/rtw89/core.c +8 -0
index 8c4dd6f4a797..1cdf78a9a297 100644
@@ -5552,6 +5552,7 @@ void rtw89_core_dm_disable_cfg(struct rtw89_dev *rtwdev, u32 new)
 {
 	struct rtw89_hal *hal = &rtwdev->hal;
 	u32 old = hal->disabled_dm_bitmap;
+	u32 changes = new ^ old;
 
 	if (new == old)
 		return;
@@ -5559,6 +5560,13 @@ void rtw89_core_dm_disable_cfg(struct rtw89_dev *rtwdev, u32 new)
 	hal->disabled_dm_bitmap = new;
 
 	rtw89_debug(rtwdev, RTW89_DBG_STATE, "Disable DM: 0x%x -> 0x%x\n", old, new);
+
+	if (changes & BIT(RTW89_DM_REGD_LEARN)) {
+		if (new & BIT(RTW89_DM_REGD_LEARN))
+			rtw89_regd_learn_cancel(rtwdev);
+		else
+			rtw89_regd_learn_queue(rtwdev);
+	}
 }
 
 void rtw89_core_dm_disable_set(struct rtw89_dev *rtwdev, enum rtw89_dm_type type)
drivers/net/wireless/realtek/rtw89/core.h +1 -0
index d0a42f09fa13..27fe4c0fa316 100644
@@ -6485,6 +6485,7 @@ enum rtw89_dm_type {
 	RTW89_DM_INACTIVE_PS,
 	RTW89_DM_DIG_PD,
 	RTW89_DM_VCORE,
+	RTW89_DM_REGD_LEARN,
 };
 
 #define RTW89_THERMAL_PROT_LV_MAX 5
drivers/net/wireless/realtek/rtw89/debug.c +1 -0
index 3b7f8a8090fa..3ebe4aa04e2b 100644
@@ -4780,6 +4780,7 @@ static const struct rtw89_disabled_dm_info {
 	DM_INFO(INACTIVE_PS),
 	DM_INFO(DIG_PD),
 	DM_INFO(VCORE),
+	DM_INFO(REGD_LEARN),
 };
 
 static ssize_t
drivers/net/wireless/realtek/rtw89/regd.c +4 -0
index 89be36ccd84b..f75ce808254c 100644
@@ -715,6 +715,7 @@ void rtw89_regd_learn_queue(struct rtw89_dev *rtwdev)
 		4, 16, 64, 256, 1024, 4096,
 	};
 	struct wiphy *wiphy = rtwdev->hw->wiphy;
+	struct rtw89_hal *hal = &rtwdev->hal;
 	unsigned int delay;
 	unsigned int index;
 
@@ -726,6 +727,9 @@ void rtw89_regd_learn_queue(struct rtw89_dev *rtwdev)
 	if (!regd_learn->shall_run)
 		return;
 
+	if (hal->disabled_dm_bitmap & BIT(RTW89_DM_REGD_LEARN))
+		return;
+
 	rtw89_debug(rtwdev, RTW89_DBG_REGD, "regd_learn: queue (retry=%u)\n",
 		    regd_learn->retry);
 
Signature · 1 line
2.25.1