[PATCH 5.2 300/413] iwlwifi: mvm: clear rfkill_safe_init_done when we start the firmware

From: Greg Kroah-Hartman
Date: Wed Jul 24 2019 - 15:39:27 EST


From: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>

commit 940225628652b340b2bfe99f42f3d2db9fd9ce6c upstream.

Otherwise it'll stay set forever which is clearly buggy.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>
Signed-off-by: Luca Coelho <luciano.coelho@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -419,6 +419,8 @@ static int iwl_run_unified_mvm_ucode(str

lockdep_assert_held(&mvm->mutex);

+ mvm->rfkill_safe_init_done = false;
+
iwl_init_notification_wait(&mvm->notif_wait,
&init_wait,
init_complete,
@@ -537,8 +539,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mv

lockdep_assert_held(&mvm->mutex);

- if (WARN_ON_ONCE(mvm->rfkill_safe_init_done))
- return 0;
+ mvm->rfkill_safe_init_done = false;

iwl_init_notification_wait(&mvm->notif_wait,
&calib_wait,
@@ -1108,10 +1109,13 @@ static int iwl_mvm_load_rt_fw(struct iwl

iwl_fw_dbg_apply_point(&mvm->fwrt, IWL_FW_INI_APPLY_EARLY);

+ mvm->rfkill_safe_init_done = false;
ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR);
if (ret)
return ret;

+ mvm->rfkill_safe_init_done = true;
+
iwl_fw_dbg_apply_point(&mvm->fwrt, IWL_FW_INI_APPLY_AFTER_ALIVE);

return iwl_init_paging(&mvm->fwrt, mvm->fwrt.cur_fw_img);