Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a79a0c0 authored by Eliad Peller's avatar Eliad Peller Committed by Emmanuel Grumbach
Browse files

iwlwifi: mvm: clear IN_HW_RESTART flag on stop()



On stop(), we already cleared our internal state,
and the restart_complete() callback won't be
called, so simply clear the IN_HW_RESTART flag.

Keeping the flag might result in invalid state
on the next start(), preventing the driver starting
properly.

Additionally, don't take IWL_MVM_REF_UCODE_DOWN on stop()
if hw restart was requested, as the ref was already
taken in this case.

Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 70e71ca0
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1004,7 +1004,12 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
{
	lockdep_assert_held(&mvm->mutex);

	/* disallow low power states when the FW is down */
	/*
	 * 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 */
@@ -1023,6 +1028,12 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm)
	/* the fw is stopped, the aux sta is dead: clean up driver state */
	iwl_mvm_del_aux_sta(mvm);

	/*
	 * Clear IN_HW_RESTART flag when stopping the hw (as restart_complete()
	 * won't be called in this case).
	 */
	clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);

	mvm->ucode_loaded = false;
}