aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel
diff options
context:
space:
mode:
authorChaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>2016-02-22 03:21:41 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2016-03-02 01:56:58 -0500
commitfcb6b92a682fe5032fdc31af7f8ed86f1dabb1e2 (patch)
tree93b7d6182920c18848f5b091b91d1e42fbb0bb8b /drivers/net/wireless/intel
parent3d2d442236b3f87cf9ff70c4252488ed7c6d5be8 (diff)
iwlwifi: mvm: update ucode status before stopping device
Leaving ucode_loaded to true after stop_device() has been called is a recipe for problems. Flows that are not sync'ed with the driver life cycle (like debugfs hooks and thermal hooks) must check that the firmware is loaded before they interact with it. Therefore we need to keep this variable updated with the real status of the firmware. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/d3.c3
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/fw.c4
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c6
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mvm.h6
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/ops.c2
5 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index cf5e6349301e..c1a313149eed 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -816,8 +816,7 @@ static int iwl_mvm_switch_to_d3(struct iwl_mvm *mvm)
816{ 816{
817 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); 817 iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true);
818 818
819 iwl_trans_stop_device(mvm->trans); 819 iwl_mvm_stop_device(mvm);
820
821 /* 820 /*
822 * Set the HW restart bit -- this is mostly true as we're 821 * Set the HW restart bit -- this is mostly true as we're
823 * going to load new firmware and reprogram that, though 822 * going to load new firmware and reprogram that, though
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index f075c36a77c5..efec6ec22f58 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -1009,7 +1009,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
1009 IWL_DEBUG_INFO(mvm, "RT uCode started.\n"); 1009 IWL_DEBUG_INFO(mvm, "RT uCode started.\n");
1010 return 0; 1010 return 0;
1011 error: 1011 error:
1012 iwl_trans_stop_device(mvm->trans); 1012 iwl_mvm_stop_device(mvm);
1013 return ret; 1013 return ret;
1014} 1014}
1015 1015
@@ -1053,7 +1053,7 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm)
1053 1053
1054 return 0; 1054 return 0;
1055 error: 1055 error:
1056 iwl_trans_stop_device(mvm->trans); 1056 iwl_mvm_stop_device(mvm);
1057 return ret; 1057 return ret;
1058} 1058}
1059 1059
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 927b0559d42d..ec6b07282e7d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -972,7 +972,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
972 */ 972 */
973 iwl_mvm_unref_all_except(mvm, IWL_MVM_REF_UCODE_DOWN); 973 iwl_mvm_unref_all_except(mvm, IWL_MVM_REF_UCODE_DOWN);
974 974
975 iwl_trans_stop_device(mvm->trans); 975 iwl_mvm_stop_device(mvm);
976 976
977 mvm->scan_status = 0; 977 mvm->scan_status = 0;
978 mvm->ps_disabled = false; 978 mvm->ps_disabled = false;
@@ -1141,7 +1141,7 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
1141 */ 1141 */
1142 flush_work(&mvm->roc_done_wk); 1142 flush_work(&mvm->roc_done_wk);
1143 1143
1144 iwl_trans_stop_device(mvm->trans); 1144 iwl_mvm_stop_device(mvm);
1145 1145
1146 iwl_mvm_async_handlers_purge(mvm); 1146 iwl_mvm_async_handlers_purge(mvm);
1147 /* async_handlers_list is empty and will stay empty: HW is stopped */ 1147 /* async_handlers_list is empty and will stay empty: HW is stopped */
@@ -1172,8 +1172,6 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
1172 mvm->scan_uid_status[i] = 0; 1172 mvm->scan_uid_status[i] = 0;
1173 } 1173 }
1174 } 1174 }
1175
1176 mvm->ucode_loaded = false;
1177} 1175}
1178 1176
1179static void iwl_mvm_mac_stop(struct ieee80211_hw *hw) 1177static void iwl_mvm_mac_stop(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index b461b909e7af..6d4e4879357c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1549,6 +1549,12 @@ void iwl_mvm_enable_ac_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
1549 iwl_mvm_enable_txq(mvm, queue, mac80211_queue, ssn, &cfg, wdg_timeout); 1549 iwl_mvm_enable_txq(mvm, queue, mac80211_queue, ssn, &cfg, wdg_timeout);
1550} 1550}
1551 1551
1552static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm)
1553{
1554 mvm->ucode_loaded = false;
1555 iwl_trans_stop_device(mvm->trans);
1556}
1557
1552/* Thermal management and CT-kill */ 1558/* Thermal management and CT-kill */
1553void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff); 1559void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff);
1554void iwl_mvm_tt_temp_changed(struct iwl_mvm *mvm, u32 temp); 1560void iwl_mvm_tt_temp_changed(struct iwl_mvm *mvm, u32 temp);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 8bdaa7b27ab1..4716176cbfe0 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -643,7 +643,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
643 iwl_mvm_ref(mvm, IWL_MVM_REF_INIT_UCODE); 643 iwl_mvm_ref(mvm, IWL_MVM_REF_INIT_UCODE);
644 err = iwl_run_init_mvm_ucode(mvm, true); 644 err = iwl_run_init_mvm_ucode(mvm, true);
645 if (!err || !iwlmvm_mod_params.init_dbg) 645 if (!err || !iwlmvm_mod_params.init_dbg)
646 iwl_trans_stop_device(trans); 646 iwl_mvm_stop_device(mvm);
647 iwl_mvm_unref(mvm, IWL_MVM_REF_INIT_UCODE); 647 iwl_mvm_unref(mvm, IWL_MVM_REF_INIT_UCODE);
648 mutex_unlock(&mvm->mutex); 648 mutex_unlock(&mvm->mutex);
649 /* returns 0 if successful, 1 if success but in rfkill */ 649 /* returns 0 if successful, 1 if success but in rfkill */