From f594a27da240a693b0053312afa6e3bac95659fa Mon Sep 17 00:00:00 2001 From: HiGarfield Date: Tue, 10 Oct 2023 02:04:51 +0800 Subject: [PATCH] mac80211: wifi: rt2x00: various experimental improvements for MT7620 --- ...07-rt2800-enable-watchdog-by-default.patch | 25 -- ...rror-Attempt-to-send-packet-over-in.patch} | 0 ...explicitly-signed-or-unsigned-types.patch} | 0 ...es.patch => 9999-009-backport-fixes.patch} | 0 ...-wifi-rt2x00-Remove-useless-else-if.patch} | 0 ...x-memory-leak-when-handling-surveys.patch} | 0 ...-MT7620-TX-power-based-on-eeprom-ca.patch} | 0 ...rework-MT7620-PA-LNA-RF-calibration.patch} | 0 ...fi-rt2x00-fix-MT7620-low-RSSI-issue.patch} | 0 ...ous-experimental-improvements-for-MT.patch | 388 ++++++++++++++++++ 10 files changed, 388 insertions(+), 25 deletions(-) delete mode 100644 package/kernel/mac80211/patches/rt2x00/9999-007-rt2800-enable-watchdog-by-default.patch rename package/kernel/mac80211/patches/rt2x00/{9999-008-wifi-rt2x00-Fix-Error-Attempt-to-send-packet-over-in.patch => 9999-007-wifi-rt2x00-Fix-Error-Attempt-to-send-packet-over-in.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-009-wifi-rt2x00-use-explicitly-signed-or-unsigned-types.patch => 9999-008-wifi-rt2x00-use-explicitly-signed-or-unsigned-types.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-010-backport-fixes.patch => 9999-009-backport-fixes.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-011-wifi-rt2x00-Remove-useless-else-if.patch => 9999-010-wifi-rt2x00-Remove-useless-else-if.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-012-rt2x00-Fix-memory-leak-when-handling-surveys.patch => 9999-011-rt2x00-Fix-memory-leak-when-handling-surveys.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-013-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch => 9999-012-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-014-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch => 9999-013-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch} (100%) rename package/kernel/mac80211/patches/rt2x00/{9999-015-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch => 9999-014-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch} (100%) create mode 100644 package/kernel/mac80211/patches/rt2x00/9999-015-wifi-rt2x00-various-experimental-improvements-for-MT.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-007-rt2800-enable-watchdog-by-default.patch b/package/kernel/mac80211/patches/rt2x00/9999-007-rt2800-enable-watchdog-by-default.patch deleted file mode 100644 index 5417b9cd0..000000000 --- a/package/kernel/mac80211/patches/rt2x00/9999-007-rt2800-enable-watchdog-by-default.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8f8d8bb6292221e170718d888f9250804f7a1da8 Mon Sep 17 00:00:00 2001 -From: HiGarfield -Date: Tue, 9 Aug 2022 03:17:42 +0800 -Subject: [PATCH] rt2800: enable watchdog by default - ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -index d3a54ed..f4e4373 100644 ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -42,7 +42,7 @@ - #include "rt2800lib.h" - #include "rt2800.h" - --static bool modparam_watchdog; -+static bool modparam_watchdog = true; - module_param_named(watchdog, modparam_watchdog, bool, S_IRUGO); - MODULE_PARM_DESC(watchdog, "Enable watchdog to detect tx/rx hangs and reset hardware if detected"); - --- -2.25.1 - diff --git a/package/kernel/mac80211/patches/rt2x00/9999-008-wifi-rt2x00-Fix-Error-Attempt-to-send-packet-over-in.patch b/package/kernel/mac80211/patches/rt2x00/9999-007-wifi-rt2x00-Fix-Error-Attempt-to-send-packet-over-in.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-008-wifi-rt2x00-Fix-Error-Attempt-to-send-packet-over-in.patch rename to package/kernel/mac80211/patches/rt2x00/9999-007-wifi-rt2x00-Fix-Error-Attempt-to-send-packet-over-in.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-009-wifi-rt2x00-use-explicitly-signed-or-unsigned-types.patch b/package/kernel/mac80211/patches/rt2x00/9999-008-wifi-rt2x00-use-explicitly-signed-or-unsigned-types.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-009-wifi-rt2x00-use-explicitly-signed-or-unsigned-types.patch rename to package/kernel/mac80211/patches/rt2x00/9999-008-wifi-rt2x00-use-explicitly-signed-or-unsigned-types.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-010-backport-fixes.patch b/package/kernel/mac80211/patches/rt2x00/9999-009-backport-fixes.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-010-backport-fixes.patch rename to package/kernel/mac80211/patches/rt2x00/9999-009-backport-fixes.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-011-wifi-rt2x00-Remove-useless-else-if.patch b/package/kernel/mac80211/patches/rt2x00/9999-010-wifi-rt2x00-Remove-useless-else-if.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-011-wifi-rt2x00-Remove-useless-else-if.patch rename to package/kernel/mac80211/patches/rt2x00/9999-010-wifi-rt2x00-Remove-useless-else-if.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-012-rt2x00-Fix-memory-leak-when-handling-surveys.patch b/package/kernel/mac80211/patches/rt2x00/9999-011-rt2x00-Fix-memory-leak-when-handling-surveys.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-012-rt2x00-Fix-memory-leak-when-handling-surveys.patch rename to package/kernel/mac80211/patches/rt2x00/9999-011-rt2x00-Fix-memory-leak-when-handling-surveys.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-013-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch b/package/kernel/mac80211/patches/rt2x00/9999-012-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-013-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch rename to package/kernel/mac80211/patches/rt2x00/9999-012-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-014-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch b/package/kernel/mac80211/patches/rt2x00/9999-013-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-014-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch rename to package/kernel/mac80211/patches/rt2x00/9999-013-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-015-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch b/package/kernel/mac80211/patches/rt2x00/9999-014-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch similarity index 100% rename from package/kernel/mac80211/patches/rt2x00/9999-015-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch rename to package/kernel/mac80211/patches/rt2x00/9999-014-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch diff --git a/package/kernel/mac80211/patches/rt2x00/9999-015-wifi-rt2x00-various-experimental-improvements-for-MT.patch b/package/kernel/mac80211/patches/rt2x00/9999-015-wifi-rt2x00-various-experimental-improvements-for-MT.patch new file mode 100644 index 000000000..10abe6015 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/9999-015-wifi-rt2x00-various-experimental-improvements-for-MT.patch @@ -0,0 +1,388 @@ +From 9e051ec25fa6c0216fa0400393266a5cfe814e6e Mon Sep 17 00:00:00 2001 +From: HiGarfield +Date: Fri, 13 Oct 2023 00:16:27 +0800 +Subject: [PATCH] wifi: rt2x00: various experimental improvements for MT7620 + +--- + drivers/net/wireless/ralink/rt2x00/rt2800.h | 22 ++- + .../net/wireless/ralink/rt2x00/rt2800lib.c | 133 +++++++++++++++--- + .../net/wireless/ralink/rt2x00/rt2800mmio.c | 4 + + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 5 + + .../net/wireless/ralink/rt2x00/rt2x00dev.c | 2 +- + 5 files changed, 146 insertions(+), 20 deletions(-) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800.h b/drivers/net/wireless/ralink/rt2x00/rt2800.h +index 4713938..c0512e9 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -105,8 +105,8 @@ + /* + * Register layout information. + */ +-#define CSR_REG_BASE 0x1000 +-#define CSR_REG_SIZE 0x0800 ++#define CSR_REG_BASE 0x0000 ++#define CSR_REG_SIZE 0x1800 + #define EEPROM_BASE 0x0000 + #define EEPROM_SIZE 0x0200 + #define BBP_BASE 0x0000 +@@ -881,6 +881,18 @@ + #define LED_CFG_Y_LED_MODE FIELD32(0x30000000) + #define LED_CFG_LED_POLAR FIELD32(0x40000000) + ++/* ++ * AMPDU_MAX_LEN_20M1S: Per MCS max A-MPDU length, 20 MHz, MCS 0-7 ++ * AMPDU_MAX_LEN_20M2S: Per MCS max A-MPDU length, 20 MHz, MCS 8-15 ++ * AMPDU_MAX_LEN_40M1S: Per MCS max A-MPDU length, 40 MHz, MCS 0-7 ++ * AMPDU_MAX_LEN_40M2S: Per MCS max A-MPDU length, 40 MHz, MCS 8-15 ++ * Maximum A-MPDU length = 2^(AMPDU_MAX - 5) kilobytes ++ */ ++#define AMPDU_MAX_LEN_20M1S 0x1030 ++#define AMPDU_MAX_LEN_20M2S 0x1034 ++#define AMPDU_MAX_LEN_40M1S 0x1038 ++#define AMPDU_MAX_LEN_40M2S 0x103C ++ + /* + * AMPDU_BA_WINSIZE: Force BlockAck window size + * FORCE_WINSIZE_ENABLE: +@@ -1561,6 +1573,12 @@ + */ + #define EXP_ACK_TIME 0x1380 + ++/* ++ * HT_FBK_TO_LEGACY: Enable/Disable HT/RTS fallback to OFDM/CCK rate ++ * Not available for legacy SoCs ++ */ ++#define HT_FBK_TO_LEGACY 0x1384 ++ + /* TX_PWR_CFG_5 */ + #define TX_PWR_CFG_5 0x1384 + #define TX_PWR_CFG_5_MCS16_CH0 FIELD32(0x0000000f) +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index 955df0a..5e4a3be 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -42,9 +42,15 @@ + #include "rt2800lib.h" + #include "rt2800.h" + +-static bool modparam_watchdog; +-module_param_named(watchdog, modparam_watchdog, bool, S_IRUGO); +-MODULE_PARM_DESC(watchdog, "Enable watchdog to detect tx/rx hangs and reset hardware if detected"); ++static bool modparam_hang_wdt = true; ++module_param_named(hang_watchdog, modparam_hang_wdt, bool, S_IRUGO); ++MODULE_PARM_DESC(hang_watchdog, "Enable watchdog to detect tx/rx hangs" ++ " and reset hardware if detected"); ++ ++static bool modparam_dma_wdt = true; ++module_param_named(dma_busy_watchdog, modparam_dma_wdt, bool, S_IRUGO); ++MODULE_PARM_DESC(dma_busy_watchdog, "Enable watchdog to detect tx/rx" ++ " DMA busy and reset hardware if detected"); + + /* + * Register access. +@@ -1267,16 +1273,18 @@ void rt2800_txdone_nostatus(struct rt2x00_dev *rt2x00dev) + } + EXPORT_SYMBOL_GPL(rt2800_txdone_nostatus); + +-static int rt2800_check_hung(struct data_queue *queue) ++static bool rt2800_check_queue_hung(struct data_queue *queue) + { + unsigned int cur_idx = rt2800_drv_get_dma_done(queue); + +- if (queue->wd_idx != cur_idx) ++ if (queue->wd_idx != cur_idx) { ++ queue->wd_idx = cur_idx; + queue->wd_count = 0; ++ } + else + queue->wd_count++; + +- return queue->wd_count > 16; ++ return queue->wd_count > 64; + } + + static void rt2800_update_survey(struct rt2x00_dev *rt2x00dev) +@@ -1290,11 +1298,11 @@ static void rt2800_update_survey(struct rt2x00_dev *rt2x00dev) + chan_survey->time_ext_busy += rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC); + } + +-void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) ++static void rt2800_check_hung(struct rt2x00_dev *rt2x00dev, ++ bool *hung_rx, ++ bool *hung_tx) + { + struct data_queue *queue; +- bool hung_tx = false; +- bool hung_rx = false; + + if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) + return; +@@ -1310,7 +1318,7 @@ void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) + case QID_MGMT: + if (rt2x00queue_empty(queue)) + continue; +- hung_tx = rt2800_check_hung(queue); ++ *hung_tx = rt2800_check_queue_hung(queue) || *hung_tx; + break; + case QID_RX: + /* For station mode we should reactive at least +@@ -1319,12 +1327,57 @@ void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) + */ + if (rt2x00dev->intf_sta_count == 0) + continue; +- hung_rx = rt2800_check_hung(queue); ++ *hung_rx = rt2800_check_queue_hung(queue) || *hung_rx; + break; + default: + break; + } + } ++} ++ ++static bool rt2800_check_dma_busy(struct rt2x00_dev *rt2x00dev, bool is_tx) ++{ ++ u32 reg_cfg = rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG); ++ u32 reg_int = rt2800_register_read(rt2x00dev, INT_SOURCE_CSR); ++ ++ if (is_tx) { ++ if (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_TX_DMA_BUSY) && ++ rt2x00_get_field32(reg_int, INT_SOURCE_CSR_TX_COHERENT)) ++ rt2x00dev->txdma_busy++; ++ else ++ rt2x00dev->txdma_busy = 0; ++ ++ return rt2x00dev->txdma_busy > 16; ++ } ++ else { ++ if (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_RX_DMA_BUSY) && ++ rt2x00_get_field32(reg_int, INT_SOURCE_CSR_RX_COHERENT)) ++ rt2x00dev->rxdma_busy++; ++ else ++ rt2x00dev->rxdma_busy = 0; ++ ++ return rt2x00dev->rxdma_busy > 16; ++ } ++} ++ ++void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) ++{ ++ struct data_queue *queue; ++ bool hung_tx = false; ++ bool hung_rx = false; ++ bool hung_txdma_busy = false; ++ bool hung_rxdma_busy = false; ++ ++ if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) ++ return; ++ ++ if (modparam_hang_wdt) ++ rt2800_check_hung(rt2x00dev, &hung_rx, &hung_tx); ++ ++ if (modparam_dma_wdt) { ++ hung_txdma_busy = rt2800_check_dma_busy(rt2x00dev, true); ++ hung_rxdma_busy = rt2800_check_dma_busy(rt2x00dev, false); ++ } + + if (hung_tx) + rt2x00_warn(rt2x00dev, "Watchdog TX hung detected\n"); +@@ -1332,8 +1385,21 @@ void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) + if (hung_rx) + rt2x00_warn(rt2x00dev, "Watchdog RX hung detected\n"); + +- if (hung_tx || hung_rx) ++ if (hung_txdma_busy) ++ rt2x00_warn(rt2x00dev, "Watchdog TX DMA busy detected\n"); ++ ++ if (hung_rxdma_busy) ++ rt2x00_warn(rt2x00dev, "Watchdog RX DMA busy detected\n"); ++ ++ if (hung_tx || hung_rx || hung_txdma_busy || hung_rxdma_busy) { ++ queue_for_each(rt2x00dev, queue) ++ queue->wd_count = 0; ++ ++ rt2x00dev->txdma_busy = 0; ++ rt2x00dev->rxdma_busy = 0; ++ + ieee80211_restart_hw(rt2x00dev->hw); ++ } + } + EXPORT_SYMBOL_GPL(rt2800_watchdog); + +@@ -5844,6 +5910,21 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) + if (ret) + return ret; + ++ if (rt2x00_rt(rt2x00dev, RT6352)) { ++ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x01); ++ ++ reg = rt2800_bbp_read(rt2x00dev, 21); ++ reg |= 0x01; ++ rt2800_bbp_write(rt2x00dev, 21, reg); ++ usleep_range(100, 200); ++ reg = rt2800_bbp_read(rt2x00dev, 21); ++ reg &= (~0x01); ++ rt2800_bbp_write(rt2x00dev, 21, reg); ++ ++ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x00); ++ usleep_range(100, 200); ++ } ++ + rt2800_register_write(rt2x00dev, LEGACY_BASIC_RATE, 0x0000013f); + rt2800_register_write(rt2x00dev, HT_BASIC_RATE, 0x00008003); + +@@ -6012,6 +6093,14 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) + reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1); + rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0); + rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg); ++ ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_20M1S, 0x77754433); ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_20M2S, 0x77765543); ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_40M1S, 0x77765544); ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_40M2S, 0x77765544); ++ ++ rt2800_register_write(rt2x00dev, HT_FBK_TO_LEGACY, 0x1010); ++ + } else { + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000000); + rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); +@@ -7232,6 +7321,8 @@ static void rt2800_init_bbp_6352(struct rt2x00_dev *rt2x00dev) + rt2800_bbp_dcoc_write(rt2x00dev, 159, 0x64); + + rt2800_bbp4_mac_if_ctrl(rt2x00dev); ++ ++ rt2800_bbp_write(rt2x00dev, 84, 0x19); + } + + static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) +@@ -8649,9 +8740,11 @@ void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev) + bytevalue = rt2800_bbp_read(rt2x00dev, 21); + bytevalue |= 0x1; + rt2800_bbp_write(rt2x00dev, 21, bytevalue); ++ usleep_range(100, 200); + bytevalue = rt2800_bbp_read(rt2x00dev, 21); + bytevalue &= (~0x1); + rt2800_bbp_write(rt2x00dev, 21, bytevalue); ++ usleep_range(100, 200); + + rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, saverfb0r1); + rt2800_rfcsr_write_bank(rt2x00dev, 0, 34, saverfb0r34); +@@ -8802,8 +8895,10 @@ void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev) + bbpval = rt2800_bbp_read(rt2x00dev, 21); + bbpval = bbpval | 1; + rt2800_bbp_write(rt2x00dev, 21, bbpval); ++ usleep_range(100, 200); + bbpval = bbpval & 0xfe; + rt2800_bbp_write(rt2x00dev, 21, bbpval); ++ usleep_range(100, 200); + + rt2800_register_write(rt2x00dev, RF_CONTROL1, 0x00000202); + rt2800_register_write(rt2x00dev, RF_BYPASS1, 0x00000303); +@@ -9066,9 +9161,10 @@ restore_value: + bbpval = rt2800_bbp_read(rt2x00dev, 21); + bbpval |= 0x1; + rt2800_bbp_write(rt2x00dev, 21, bbpval); +- usleep_range(10, 200); ++ usleep_range(100, 200); + bbpval &= 0xfe; + rt2800_bbp_write(rt2x00dev, 21, bbpval); ++ usleep_range(100, 200); + + rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfb0r1); + rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, rfb0r2); +@@ -9781,8 +9877,9 @@ void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev) + rt2800_bbp_write(rt2x00dev, 244, 0x00); + + rt2800_bbp_write(rt2x00dev, 21, 0x01); +- udelay(1); ++ usleep_range(100, 200); + rt2800_bbp_write(rt2x00dev, 21, 0x00); ++ usleep_range(100, 200); + + rt2800_rf_configrecover(rt2x00dev, rf_store); + +@@ -9838,8 +9935,9 @@ void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev) + if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) { + rt2800_bbp_write(rt2x00dev, 4, bbpr4 & (~0x18)); + rt2800_bbp_write(rt2x00dev, 21, 0x01); +- udelay(1); ++ usleep_range(100, 200); + rt2800_bbp_write(rt2x00dev, 21, 0x00); ++ usleep_range(100, 200); + + rt2800_bbp_write(rt2x00dev, 241, 0x14); + rt2800_bbp_write(rt2x00dev, 242, 0x80); +@@ -10001,8 +10099,9 @@ void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev) + rt2800_bbp_write(rt2x00dev, 4, bbpr4); + + rt2800_bbp_write(rt2x00dev, 21, 0x01); +- udelay(1); ++ usleep_range(100, 200); + rt2800_bbp_write(rt2x00dev, 21, 0x00); ++ usleep_range(100, 200); + + rt2800_rf_configrecover(rt2x00dev, rf_store); + +@@ -12121,7 +12220,7 @@ int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) + __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); + } + +- if (modparam_watchdog) { ++ if (modparam_hang_wdt || modparam_dma_wdt) { + __set_bit(CAPABILITY_RESTART_HW, &rt2x00dev->cap_flags); + rt2x00dev->link.watchdog_interval = msecs_to_jiffies(100); + } else { +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +index e298b2c..87a16d6 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +@@ -751,6 +751,7 @@ int rt2800mmio_init_registers(struct rt2x00_dev *rt2x00dev) + rt2x00mmio_register_write(rt2x00dev, WPDMA_RST_IDX, reg); + + rt2x00mmio_register_write(rt2x00dev, PBF_SYS_CTRL, 0x00000e1f); ++ usleep_range(100, 200); + rt2x00mmio_register_write(rt2x00dev, PBF_SYS_CTRL, 0x00000e00); + + if (rt2x00_is_pcie(rt2x00dev) && +@@ -769,6 +770,9 @@ int rt2800mmio_init_registers(struct rt2x00_dev *rt2x00dev) + + rt2x00mmio_register_write(rt2x00dev, PWR_PIN_CFG, 0x00000003); + ++ if (rt2x00_rt(rt2x00dev, RT6352)) ++ return 0; ++ + reg = 0; + rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1); + rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_BBP, 1); +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +index fb0ae2e..6a6a5fc 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -948,6 +948,11 @@ struct rt2x00_dev { + */ + u16 beacon_int; + ++ /* ++ * RX/TX DMA busy watchdog counter ++ */ ++ u16 rxdma_busy, txdma_busy; ++ + /** + * Timestamp of last received beacon + */ +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +index 323e40b..8244451 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -740,7 +740,7 @@ static int rt2x00lib_rxdone_read_signal(struct rt2x00_dev *rt2x00dev, + break; + } + +- rt2x00_warn(rt2x00dev, "Frame received with unrecognized signal, mode=0x%.4x, signal=0x%.4x, type=%d\n", ++ rt2x00_dbg(rt2x00dev, "Frame received with unrecognized signal, mode=0x%.4x, signal=0x%.4x, type=%d\n", + rxdesc->rate_mode, signal, type); + return 0; + } +-- +2.25.1 +