iwlwifi: mvm: register to mac80211 last
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 10 Feb 2021 15:15:05 +0000 (17:15 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 10 Feb 2021 23:52:07 +0000 (01:52 +0200)
All the actions that were taken after the registration can
be taken before the registration to mac80211.
This will help to defer part of the op_mode_mvm_start
function to a later stage in case the device is not
available.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.c03cc5db67c1.Ia928ca34d25a73d959a345ffbe4f1217c3f17394@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index 3f82b219b45bc228f24be41e2be5ef6687f49ee2..573c4548e441e695cceecfdc680a115ae0899bee 100644 (file)
@@ -891,16 +891,9 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        /* Set EBS as successful as long as not stated otherwise by the FW. */
        mvm->last_ebs_successful = true;
 
-       err = iwl_mvm_mac_setup_register(mvm);
-       if (err)
-               goto out_free;
-       mvm->hw_registered = true;
-
        min_backoff = iwl_mvm_min_backoff(mvm);
        iwl_mvm_thermal_initialize(mvm, min_backoff);
 
-       iwl_mvm_dbgfs_register(mvm, dbgfs_dir);
-
        if (!iwl_mvm_has_new_rx_stats_api(mvm))
                memset(&mvm->rx_stats_v3, 0,
                       sizeof(struct mvm_statistics_rx_v3));
@@ -909,8 +902,17 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
 
        iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx);
 
+       err = iwl_mvm_mac_setup_register(mvm);
+       if (err)
+               goto out_thermal_exit;
+       mvm->hw_registered = true;
+
+       iwl_mvm_dbgfs_register(mvm, dbgfs_dir);
+
        return op_mode;
 
+ out_thermal_exit:
+       iwl_mvm_thermal_exit(mvm);
  out_free:
        iwl_fw_flush_dumps(&mvm->fwrt);
        iwl_fw_runtime_free(&mvm->fwrt);