Commit 8c46bb70 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: first enable RF kill interrupt, then check register

This can solve a race (very unlikely to happen though).
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 8d425517
...@@ -980,14 +980,13 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, ...@@ -980,14 +980,13 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
return -EIO; return -EIO;
} }
iwl_enable_rfkill_int(trans);
/* If platform's RF_KILL switch is NOT set to KILL */ /* If platform's RF_KILL switch is NOT set to KILL */
hw_rfkill = iwl_is_rfkill_set(trans); hw_rfkill = iwl_is_rfkill_set(trans);
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill)
if (hw_rfkill) {
iwl_enable_rfkill_int(trans);
return -ERFKILL; return -ERFKILL;
}
iwl_write32(trans, CSR_INT, 0xFFFFFFFF); iwl_write32(trans, CSR_INT, 0xFFFFFFFF);
...@@ -1560,15 +1559,14 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans) ...@@ -1560,15 +1559,14 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans)
{ {
bool hw_rfkill; bool hw_rfkill;
iwl_enable_rfkill_int(trans);
hw_rfkill = iwl_is_rfkill_set(trans); hw_rfkill = iwl_is_rfkill_set(trans);
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill) if (!hw_rfkill)
iwl_enable_rfkill_int(trans);
else
iwl_enable_interrupts(trans); iwl_enable_interrupts(trans);
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
return 0; return 0;
} }
#endif /* CONFIG_PM_SLEEP */ #endif /* CONFIG_PM_SLEEP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment