summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wlcore/main.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-02-10 13:47:18 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-02-13 15:20:14 -0500
commit9be86cf067f43c3a43a538189d773afc812e4017 (patch)
tree8677c171bdd00c83f525f4e1e2cfb2093ed25cd8 /drivers/net/wireless/ti/wlcore/main.c
parent02d0727ca3b0bc8194bd69cd52ddf9e4e2910890 (diff)
wlcore: cancel Tx watchdog on suspend and rearm on first Tx after
Sometimes a tx_flush during suspend fails, but the FW manages to flush out the packets during the time when the host is supsended. Cancel the Tx-watchdog on suspend to not cause a spurious recovery on resume for that case. Set a flag to reinit the watchdog on the first Tx after resume, so we'll still recover if the FW is not empty and there's indeed a problem. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/main.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index da268e85c3a6..1e191967aa26 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1767,6 +1767,12 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw,
flush_work(&wl->tx_work);
flush_delayed_work(&wl->elp_work);
+ /*
+ * Cancel the watchdog even if above tx_flush failed. We will detect
+ * it on resume anyway.
+ */
+ cancel_delayed_work(&wl->tx_watchdog_work);
+
return 0;
}
@@ -1824,6 +1830,13 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
out:
wl->wow_enabled = false;
+
+ /*
+ * Set a flag to re-init the watchdog on the first Tx after resume.
+ * That way we avoid possible conditions where Tx-complete interrupts
+ * fail to arrive and we perform a spurious recovery.
+ */
+ set_bit(WL1271_FLAG_REINIT_TX_WDOG, &wl->flags);
mutex_unlock(&wl->mutex);
return 0;