Skip to content

Commit 3b25f1a

Browse files
egrumbachlucacoelho
authored andcommitted
iwlwifi: mvm: remove the read_nvm from iwl_run_init_mvm_ucode
If we already read the NVM, we don't need to read it again. Make sure that this is the case with a WARNING. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20201209231352.8e0ffce7f873.Ie526042c4d4b93d9116c90f53180cbadef0b32cb@changeid Signed-off-by: Luca Coelho <[email protected]>
1 parent 486e93e commit 3b25f1a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/fw.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
647647
cmd_size, &phy_cfg_cmd);
648648
}
649649

650-
int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
650+
int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm)
651651
{
652652
struct iwl_notification_wait calib_wait;
653653
static const u16 init_complete[] = {
@@ -684,7 +684,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
684684
}
685685

686686
/* Read the NVM only at driver load time, no need to do this twice */
687-
if (read_nvm) {
687+
if (!mvm->nvm_data) {
688688
ret = iwl_nvm_init(mvm);
689689
if (ret) {
690690
IWL_ERR(mvm, "Failed to read NVM: %d\n", ret);
@@ -1332,7 +1332,8 @@ static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm)
13321332
if (iwl_mvm_has_unified_ucode(mvm))
13331333
return iwl_run_unified_mvm_ucode(mvm, false);
13341334

1335-
ret = iwl_run_init_mvm_ucode(mvm, false);
1335+
WARN_ON(!mvm->nvm_data);
1336+
ret = iwl_run_init_mvm_ucode(mvm);
13361337

13371338
if (ret) {
13381339
IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm);
14811481
* MVM Methods
14821482
******************/
14831483
/* uCode */
1484-
int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm);
1484+
int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm);
14851485

14861486
/* Utils */
14871487
int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,

drivers/net/wireless/intel/iwlwifi/mvm/ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
822822
goto out_free;
823823

824824
mutex_lock(&mvm->mutex);
825-
err = iwl_run_init_mvm_ucode(mvm, true);
825+
err = iwl_run_init_mvm_ucode(mvm);
826826
if (err && err != -ERFKILL)
827827
iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER);
828828
if (!iwlmvm_mod_params.init_dbg || !err)

0 commit comments

Comments
 (0)