mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
iwlwifi: mvm: don't keep an mvm ref when the interface is down
There is no reason to keep a reference when the interface is down, since we are not really doing anything. The reference is only needed when the mac80211 start op (or a hw restart) is running, to prevent going into runtime or system supend in the meantime. This will allow us to support runtime PM when the interface is down (in another patch). Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This commit is contained in:
parent
863558168d
commit
a42b2af3cf
2 changed files with 13 additions and 13 deletions
|
@ -1004,10 +1004,18 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm)
|
||||||
|
|
||||||
lockdep_assert_held(&mvm->mutex);
|
lockdep_assert_held(&mvm->mutex);
|
||||||
|
|
||||||
|
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
|
||||||
/* Clean up some internal and mac80211 state on restart */
|
/* Clean up some internal and mac80211 state on restart */
|
||||||
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
|
||||||
iwl_mvm_restart_cleanup(mvm);
|
iwl_mvm_restart_cleanup(mvm);
|
||||||
|
} else {
|
||||||
|
/* Hold the reference to prevent runtime suspend while
|
||||||
|
* the start procedure runs. It's a bit confusing
|
||||||
|
* that the UCODE_DOWN reference is taken, but it just
|
||||||
|
* means "UCODE is not UP yet". ( TODO: rename this
|
||||||
|
* reference).
|
||||||
|
*/
|
||||||
|
iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);
|
||||||
|
}
|
||||||
ret = iwl_mvm_up(mvm);
|
ret = iwl_mvm_up(mvm);
|
||||||
|
|
||||||
if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
|
if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
|
||||||
|
@ -1110,14 +1118,6 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
|
||||||
*/
|
*/
|
||||||
memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats));
|
memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats));
|
||||||
|
|
||||||
/*
|
|
||||||
* Disallow low power states when the FW is down by taking
|
|
||||||
* the UCODE_DOWN ref. in case of ongoing hw restart the
|
|
||||||
* ref is already taken, so don't take it again.
|
|
||||||
*/
|
|
||||||
if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
|
||||||
iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);
|
|
||||||
|
|
||||||
/* async_handlers_wk is now blocked */
|
/* async_handlers_wk is now blocked */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -607,8 +607,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
||||||
|
|
||||||
memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx));
|
memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx));
|
||||||
|
|
||||||
/* rpm starts with a taken ref. only set the appropriate bit here. */
|
/* rpm starts with a taken reference, we can release it now */
|
||||||
mvm->refs[IWL_MVM_REF_UCODE_DOWN] = 1;
|
iwl_trans_unref(mvm->trans);
|
||||||
|
|
||||||
iwl_mvm_tof_init(mvm);
|
iwl_mvm_tof_init(mvm);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue