Commit 520d68e7 authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by John W. Linville

wil6210: wait longer for hardware reset completion

Typical time for hardware reset, as measured, is about 200..250 msec.
Adjust sleeping to use more relaxed msleep, increase sleep interval
and increase total sleep time to be about 1sec
Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bbb2adc7
...@@ -25,6 +25,9 @@ static bool no_fw_recovery; ...@@ -25,6 +25,9 @@ static bool no_fw_recovery;
module_param(no_fw_recovery, bool, S_IRUGO | S_IWUSR); module_param(no_fw_recovery, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(no_fw_recovery, " disable FW error recovery"); MODULE_PARM_DESC(no_fw_recovery, " disable FW error recovery");
#define RST_DELAY (20) /* msec, for loop in @wil_target_reset */
#define RST_COUNT (1 + 1000/RST_DELAY) /* round up to be above 1 sec total */
/* /*
* Due to a hardware issue, * Due to a hardware issue,
* one has to read/write to/from NIC in 32-bit chunks; * one has to read/write to/from NIC in 32-bit chunks;
...@@ -388,11 +391,11 @@ static int wil_target_reset(struct wil6210_priv *wil) ...@@ -388,11 +391,11 @@ static int wil_target_reset(struct wil6210_priv *wil)
W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0); W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
wmb(); /* order is important here */ wmb(); /* order is important here */
/* wait until device ready */ /* wait until device ready. typical time is 200..250 msec */
do { do {
msleep(1); msleep(RST_DELAY);
hw_state = R(RGF_USER_HW_MACHINE_STATE); hw_state = R(RGF_USER_HW_MACHINE_STATE);
if (delay++ > 100) { if (delay++ > RST_COUNT) {
wil_err(wil, "Reset not completed, hw_state 0x%08x\n", wil_err(wil, "Reset not completed, hw_state 0x%08x\n",
hw_state); hw_state);
return -ETIME; return -ETIME;
...@@ -406,7 +409,7 @@ static int wil_target_reset(struct wil6210_priv *wil) ...@@ -406,7 +409,7 @@ static int wil_target_reset(struct wil6210_priv *wil)
C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD); C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD);
wmb(); /* order is important here */ wmb(); /* order is important here */
wil_dbg_misc(wil, "Reset completed in %d ms\n", delay); wil_dbg_misc(wil, "Reset completed in %d ms\n", delay * RST_DELAY);
return 0; return 0;
#undef R #undef R
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment