1 From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
2 Date: Wed, 30 Nov 2016 10:59:29 +0530
3 Subject: [PATCH] ath10k: Fix soft lockup during firmware crash/hw-restart
5 During firmware crash (or) user requested manual restart
6 the system gets into a soft lock up state because of the
9 During user requested hardware restart / firmware crash
10 the system goes into a soft lockup state as 'napi_synchronize'
11 is called after 'napi_disable' (which sets 'NAPI_STATE_SCHED'
12 bit) and it sleeps into infinite loop as it waits for
13 'NAPI_STATE_SCHED' to be cleared. This condition is hit because
14 'ath10k_hif_stop' is called twice as below (resulting in calling
15 'napi_synchronize' after 'napi_disable')
17 'ath10k_core_restart' -> 'ath10k_hif_stop' (ATH10K_STATE_ON) ->
18 -> 'ieee80211_restart_hw' -> 'ath10k_start' -> 'ath10k_halt' ->
19 'ath10k_core_stop' -> 'ath10k_hif_stop' (ATH10K_STATE_RESTARTING)
21 Fix this by calling 'ath10k_halt' in ath10k_core_restart itself
22 as it makes more sense before informing mac80211 to restart h/w
23 Also remove 'ath10k_halt' in ath10k_start for the state of 'restarting'
25 Fixes: 3c97f5de1f28 ("ath10k: implement NAPI support")
26 Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
29 --- a/drivers/net/wireless/ath/ath10k/core.c
30 +++ b/drivers/net/wireless/ath/ath10k/core.c
31 @@ -1534,7 +1534,7 @@ static void ath10k_core_restart(struct w
34 ar->state = ATH10K_STATE_RESTARTING;
35 - ath10k_hif_stop(ar);
37 ath10k_scan_finish(ar);
38 ieee80211_restart_hw(ar->hw);
40 --- a/drivers/net/wireless/ath/ath10k/mac.c
41 +++ b/drivers/net/wireless/ath/ath10k/mac.c
42 @@ -4470,7 +4470,6 @@ static int ath10k_start(struct ieee80211
43 ar->state = ATH10K_STATE_ON;
45 case ATH10K_STATE_RESTARTING:
47 ar->state = ATH10K_STATE_RESTARTED;