Commit c2cac2f7 authored by Mohammed Shafi Shajakhan's avatar Mohammed Shafi Shajakhan Committed by Kalle Valo

ath10k: fix soft lockup during firmware crash/hw-restart

During firmware crash (or) user requested manual restart
the system gets into a soft lock up state because of the
below root cause.

During user requested hardware restart / firmware crash
the system goes into a soft lockup state as 'napi_synchronize'
is called after 'napi_disable' (which sets 'NAPI_STATE_SCHED'
bit) and it sleeps into infinite loop as it waits for
'NAPI_STATE_SCHED' to be cleared. This condition is hit because
'ath10k_hif_stop' is called twice as below (resulting in calling
'napi_synchronize' after 'napi_disable')

'ath10k_core_restart' -> 'ath10k_hif_stop' (ATH10K_STATE_ON) ->
-> 'ieee80211_restart_hw' -> 'ath10k_start' -> 'ath10k_halt' ->
'ath10k_core_stop' -> 'ath10k_hif_stop' (ATH10K_STATE_RESTARTING)

Fix this by calling 'ath10k_halt' in ath10k_core_restart itself
as it makes more sense before informing mac80211 to restart h/w
Also remove 'ath10k_halt' in ath10k_start for the state of 'restarting'

Fixes: 3c97f5de ("ath10k: implement NAPI support")
Cc: <stable@vger.kernel.org> # v4.9
Signed-off-by: default avatarMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 4e322f7d
...@@ -1537,7 +1537,7 @@ static void ath10k_core_restart(struct work_struct *work) ...@@ -1537,7 +1537,7 @@ static void ath10k_core_restart(struct work_struct *work)
switch (ar->state) { switch (ar->state) {
case ATH10K_STATE_ON: case ATH10K_STATE_ON:
ar->state = ATH10K_STATE_RESTARTING; ar->state = ATH10K_STATE_RESTARTING;
ath10k_hif_stop(ar); ath10k_halt(ar);
ath10k_scan_finish(ar); ath10k_scan_finish(ar);
ieee80211_restart_hw(ar->hw); ieee80211_restart_hw(ar->hw);
break; break;
......
...@@ -4451,7 +4451,6 @@ static int ath10k_start(struct ieee80211_hw *hw) ...@@ -4451,7 +4451,6 @@ static int ath10k_start(struct ieee80211_hw *hw)
ar->state = ATH10K_STATE_ON; ar->state = ATH10K_STATE_ON;
break; break;
case ATH10K_STATE_RESTARTING: case ATH10K_STATE_RESTARTING:
ath10k_halt(ar);
ar->state = ATH10K_STATE_RESTARTED; ar->state = ATH10K_STATE_RESTARTED;
break; break;
case ATH10K_STATE_ON: case ATH10K_STATE_ON:
......
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