Commit 22a1ee8e authored by Mordechay Goodstein's avatar Mordechay Goodstein Committed by Luca Coelho
Browse files

iwlwifi: return op_mode only in case the failure is from MEI



Currently we always return the op_mode with valid pointer in case
getting NVM failed, while it's only relevant for cases that CSME is the
owner of the nic.

Fix this by checking also who's the owner of the nic.

Signed-off-by: default avatarMordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211219132536.b1e96021b616.Id0164855f2dd01ecdecf79b239d6ee5974882245@changeid


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 0792df68
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -1303,13 +1303,19 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,

	mvm->mei_registered = !iwl_mei_register(mvm, &mei_ops);

	if (iwl_mvm_start_get_nvm(mvm)) {
		/*
	 * Get NVM failed, but we are registered to MEI, we'll get
	 * the NVM later when it'll be possible to get it from CSME.
		 * Getting NVM failed while CSME is the owner, but we are
		 * registered to MEI, we'll get the NVM later when it'll be
		 * possible to get it from CSME.
		 */
	if (iwl_mvm_start_get_nvm(mvm) && mvm->mei_registered)
		if (trans->csme_own && mvm->mei_registered)
			return op_mode;

		goto out_thermal_exit;
	}


	if (iwl_mvm_start_post_nvm(mvm))
		goto out_thermal_exit;