From: Amitkumar Karwar <amit.kar...@redpinesignals.com>

Firmware's watchdog timer should be disabled as a part of reset
sequence. This change fixes a firmware hang issue observed during
stress tests.

Signed-off-by: Amitkumar Karwar <amit.kar...@redpinesignals.com>
Signed-off-by: Siva Rebbagondla <siva.rebbagon...@redpinesignals.com>
---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 7 +++++++
 drivers/net/wireless/rsi/rsi_hal.h     | 1 +
 drivers/net/wireless/rsi/rsi_usb.h     | 1 +
 3 files changed, 9 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c 
b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 7b8bae3..b065438 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -687,6 +687,13 @@ static int rsi_reset_card(struct rsi_hw *adapter)
         */
        msleep(100);
 
+       if (rsi_usb_master_reg_write(adapter, SWBL_REGOUT,
+                                    RSI_FW_WDT_DISABLE_REQ,
+                                    RSI_COMMON_REG_SIZE) < 0) {
+               rsi_dbg(ERR_ZONE, "Disabling firmware watchdog timer failed\n");
+               goto fail;
+       }
+
        ret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_TIMER_1,
                                 RSI_ULP_WRITE_2, 32);
        if (ret < 0)
diff --git a/drivers/net/wireless/rsi/rsi_hal.h 
b/drivers/net/wireless/rsi/rsi_hal.h
index d6c2baa..327638c 100644
--- a/drivers/net/wireless/rsi/rsi_hal.h
+++ b/drivers/net/wireless/rsi/rsi_hal.h
@@ -115,6 +115,7 @@
 #define FW_FLASH_OFFSET                        0x820
 #define LMAC_VER_OFFSET                        (FW_FLASH_OFFSET + 0x200)
 #define MAX_DWORD_ALIGN_BYTES          64
+#define RSI_COMMON_REG_SIZE            2
 
 struct bl_header {
        __le32 flags;
diff --git a/drivers/net/wireless/rsi/rsi_usb.h 
b/drivers/net/wireless/rsi/rsi_usb.h
index a88d592..b6fe79f 100644
--- a/drivers/net/wireless/rsi/rsi_usb.h
+++ b/drivers/net/wireless/rsi/rsi_usb.h
@@ -26,6 +26,7 @@
 #define RSI_USB_READY_MAGIC_NUM      0xab
 #define FW_STATUS_REG                0x41050012
 #define RSI_TA_HOLD_REG              0x22000844
+#define RSI_FW_WDT_DISABLE_REQ      0x69
 
 #define USB_VENDOR_REGISTER_READ     0x15
 #define USB_VENDOR_REGISTER_WRITE    0x16
-- 
2.7.4

Reply via email to