summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/wow.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2015-08-05 13:08:38 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2015-08-13 14:22:49 +0300
commit6f7429c29b9979d64d067543caec940bbc023340 (patch)
tree8e4d59eb76c0f571249e8a2e75b65f4777e9e58e /drivers/net/wireless/ath/ath10k/wow.c
parent84e3df60f0daba5b1e7874101502d0b030afb867 (diff)
downloadlinux-6f7429c29b9979d64d067543caec940bbc023340.tar.xz
ath10k: fix hw reconfig on wow failure
When WoWLAN resume fails with retval 1 mac80211 will attempt to reconfig the device in a similar manner when hw restart is requested. This wasn't handled properly and yielded call trace warnings and the device ended up not working. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wow.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/wow.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wow.c b/drivers/net/wireless/ath/ath10k/wow.c
index a68d8fd853a3..8e02b381990f 100644
--- a/drivers/net/wireless/ath/ath10k/wow.c
+++ b/drivers/net/wireless/ath/ath10k/wow.c
@@ -301,8 +301,26 @@ int ath10k_wow_op_resume(struct ieee80211_hw *hw)
ath10k_warn(ar, "failed to wakeup from wow: %d\n", ret);
exit:
+ if (ret) {
+ switch (ar->state) {
+ case ATH10K_STATE_ON:
+ ar->state = ATH10K_STATE_RESTARTING;
+ ret = 1;
+ break;
+ case ATH10K_STATE_OFF:
+ case ATH10K_STATE_RESTARTING:
+ case ATH10K_STATE_RESTARTED:
+ case ATH10K_STATE_UTF:
+ case ATH10K_STATE_WEDGED:
+ ath10k_warn(ar, "encountered unexpected device state %d on resume, cannot recover\n",
+ ar->state);
+ ret = -EIO;
+ break;
+ }
+ }
+
mutex_unlock(&ar->conf_mutex);
- return ret ? 1 : 0;
+ return ret;
}
int ath10k_wow_init(struct ath10k *ar)