iwlwifi: mvm: make init_dbg effective only on failure
authorLiad Kaufman <liad.kaufman@intel.com>
Thu, 23 Nov 2017 08:29:04 +0000 (10:29 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 5 Dec 2017 19:01:43 +0000 (21:01 +0200)
If FW loads without a problem, leaving init_dbg on can
cause a confusion, since the user won't necessarily
remember it is still turned on, and there are flows in
which everything continues as usual, only without
stopping the device after INIT, even if there is no FW
assert. On 22000 HW, for instance, this causes a
warning, since the paging is getting initialized twice.

Solve the issue by making this module param effective
only if the FW indeed asserts during INIT.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index 3019ed9..0920be6 100644 (file)
@@ -923,11 +923,11 @@ static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm)
 
        ret = iwl_run_init_mvm_ucode(mvm, false);
 
-       if (iwlmvm_mod_params.init_dbg)
-               return 0;
-
        if (ret) {
                IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
+
+               if (iwlmvm_mod_params.init_dbg)
+                       return 0;
                return ret;
        }
 
@@ -1111,7 +1111,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
        IWL_DEBUG_INFO(mvm, "RT uCode started.\n");
        return 0;
  error:
-       if (!iwlmvm_mod_params.init_dbg)
+       if (!iwlmvm_mod_params.init_dbg || !ret)
                iwl_mvm_stop_device(mvm);
        return ret;
 }
index 4773950..f32edc1 100644 (file)
@@ -746,7 +746,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        mutex_lock(&mvm->mutex);
        iwl_mvm_ref(mvm, IWL_MVM_REF_INIT_UCODE);
        err = iwl_run_init_mvm_ucode(mvm, true);
-       if (!iwlmvm_mod_params.init_dbg)
+       if (!iwlmvm_mod_params.init_dbg || !err)
                iwl_mvm_stop_device(mvm);
        iwl_mvm_unref(mvm, IWL_MVM_REF_INIT_UCODE);
        mutex_unlock(&mvm->mutex);