kernel: add missing config symbols for 4.9
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 333-ath10k-Fix-soft-lockup-during-firmware-crash-hw-rest.patch
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
4
5 During firmware crash (or) user requested manual restart
6 the system gets into a soft lock up state because of the
7 below root cause.
8
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')
16
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)
20
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'
24
25 Fixes: 3c97f5de1f28 ("ath10k: implement NAPI support")
26 Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
27 ---
28
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
32 switch (ar->state) {
33 case ATH10K_STATE_ON:
34 ar->state = ATH10K_STATE_RESTARTING;
35 - ath10k_hif_stop(ar);
36 + ath10k_halt(ar);
37 ath10k_scan_finish(ar);
38 ieee80211_restart_hw(ar->hw);
39 break;
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;
44 break;
45 case ATH10K_STATE_RESTARTING:
46 - ath10k_halt(ar);
47 ar->state = ATH10K_STATE_RESTARTED;
48 break;
49 case ATH10K_STATE_ON: