]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: debug: disable hw_scan for latency-sensitive scenarios
authorJohnson Tsai <wenjie.tsai@realtek.com>
Mon, 20 Apr 2026 03:40:38 +0000 (11:40 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 29 Apr 2026 04:32:26 +0000 (12:32 +0800)
This helps avoid scan-triggered off-channel activity during
latency-sensitive scenarios.

Add RTW89_DM_HW_SCAN to the disabled_dm bitmap via debugfs and
check it in the hw_scan path. When set, the driver rejects hw_scan
requests and returns -EBUSY.

Signed-off-by: Johnson Tsai <wenjie.tsai@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260420034051.17666-4-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/debug.c
drivers/net/wireless/realtek/rtw89/mac80211.c

index ea123567ee174b438a76421e99caef8853bc3eb5..b2dfed064555523b5b93f383c90f238afb51f059 100644 (file)
@@ -5178,6 +5178,7 @@ enum rtw89_dm_type {
        RTW89_DM_THERMAL_PROTECT,
        RTW89_DM_TAS,
        RTW89_DM_MLO,
+       RTW89_DM_HW_SCAN,
 };
 
 #define RTW89_THERMAL_PROT_LV_MAX 5
index 7d8d223110186b559b8ba735ced26a123d474a20..02386d1d07c625148267510e1ad14325a0161f74 100644 (file)
@@ -4347,6 +4347,7 @@ static const struct rtw89_disabled_dm_info {
        DM_INFO(THERMAL_PROTECT),
        DM_INFO(TAS),
        DM_INFO(MLO),
+       DM_INFO(HW_SCAN),
 };
 
 static ssize_t
index 501c3af1da01a9c3cd19f037361bc4b0230435e6..9ee2aa225976d7dc173334e2473c58ac9915748f 100644 (file)
@@ -1241,6 +1241,7 @@ static int rtw89_ops_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        struct rtw89_dev *rtwdev = hw->priv;
        struct rtw89_vif *rtwvif = vif_to_rtwvif(vif);
        struct rtw89_vif_link *rtwvif_link;
+       struct rtw89_hal *hal = &rtwdev->hal;
        int ret;
 
        lockdep_assert_wiphy(hw->wiphy);
@@ -1248,6 +1249,12 @@ static int rtw89_ops_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        if (!RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw))
                return 1;
 
+       if (hal->disabled_dm_bitmap & BIT(RTW89_DM_HW_SCAN)) {
+               rtw89_debug(rtwdev, RTW89_DBG_HW_SCAN,
+                           "reject hw scan due to disabled_dm\n");
+               return -EBUSY;
+       }
+
        if (rtwdev->scanning || rtwvif->offchan)
                return -EBUSY;