From: Felix Fietkau Date: Tue, 13 Dec 2016 11:52:16 +0000 (+0100) Subject: ath10k: fix a soft-lockup on firmware restart X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=28f6951600d0da31363e9b17dbad3f47097f4104;p=openwrt%2Fstaging%2Fyousong.git ath10k: fix a soft-lockup on firmware restart Signed-off-by: Felix Fietkau --- diff --git a/package/kernel/mac80211/patches/333-ath10k-Fix-soft-lockup-during-firmware-crash-hw-rest.patch b/package/kernel/mac80211/patches/333-ath10k-Fix-soft-lockup-during-firmware-crash-hw-rest.patch new file mode 100644 index 0000000000..89ff1fcfd8 --- /dev/null +++ b/package/kernel/mac80211/patches/333-ath10k-Fix-soft-lockup-during-firmware-crash-hw-rest.patch @@ -0,0 +1,49 @@ +From: Mohammed Shafi Shajakhan +Date: Wed, 30 Nov 2016 10:59:29 +0530 +Subject: [PATCH] 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: 3c97f5de1f28 ("ath10k: implement NAPI support") +Signed-off-by: Mohammed Shafi Shajakhan +--- + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -1534,7 +1534,7 @@ static void ath10k_core_restart(struct w + switch (ar->state) { + case ATH10K_STATE_ON: + ar->state = ATH10K_STATE_RESTARTING; +- ath10k_hif_stop(ar); ++ ath10k_halt(ar); + ath10k_scan_finish(ar); + ieee80211_restart_hw(ar->hw); + break; +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -4470,7 +4470,6 @@ static int ath10k_start(struct ieee80211 + ar->state = ATH10K_STATE_ON; + break; + case ATH10K_STATE_RESTARTING: +- ath10k_halt(ar); + ar->state = ATH10K_STATE_RESTARTED; + break; + case ATH10K_STATE_ON: diff --git a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch index 3177c812fb..d47e2a6e25 100644 --- a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -7815,6 +7815,21 @@ struct ath10k_vif *ath10k_get_arvif(stru +@@ -7812,6 +7812,21 @@ struct ath10k_vif *ath10k_get_arvif(stru return arvif_iter.arvif; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -8048,6 +8063,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -8045,6 +8060,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->wiphy->cipher_suites = cipher_suites; ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);