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

Commit 40503f7b authored by Amit Beka's avatar Amit Beka Committed by Johannes Berg
Browse files

iwlwifi: fix FW restart on init FW



When unregistered with mac80211, we can't call its functionality
for FW restart, so avoid it and prevent automatic FW restart for
the init firmware.

Signed-off-by: default avatarAmit Beka <amit.beka@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 289e5501
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -862,6 +862,7 @@ void iwl_down(struct iwl_priv *priv)
	 * No race since we hold the mutex here and a new one
	 * No race since we hold the mutex here and a new one
	 * can't come in at this time.
	 * can't come in at this time.
	 */
	 */
	if (priv->ucode_loaded && priv->cur_ucode != IWL_UCODE_INIT)
		ieee80211_remain_on_channel_expired(priv->hw);
		ieee80211_remain_on_channel_expired(priv->hw);


	exit_pending =
	exit_pending =
@@ -994,7 +995,11 @@ static void iwl_bg_restart(struct work_struct *data)
		iwlagn_prepare_restart(priv);
		iwlagn_prepare_restart(priv);
		mutex_unlock(&priv->mutex);
		mutex_unlock(&priv->mutex);
		iwl_cancel_deferred_work(priv);
		iwl_cancel_deferred_work(priv);
		if (priv->mac80211_registered)
			ieee80211_restart_hw(priv->hw);
			ieee80211_restart_hw(priv->hw);
		else
			IWL_ERR(priv,
				"Cannot request restart before registrating with mac80211");
	} else {
	} else {
		WARN_ON(1);
		WARN_ON(1);
	}
	}