diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-03-28 09:57:46 +0200 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-04-23 14:19:06 -0700 |
commit | 8c46bb703b28ea481c28bc77f2595b32d5dacea9 (patch) | |
tree | d386cbc16317dea4b21ce03c74eedc9d63950b5a /drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |
parent | 8d425517f1f08f01a6171d22e05be62ef6ad93fc (diff) | |
download | lwn-8c46bb703b28ea481c28bc77f2595b32d5dacea9.tar.gz lwn-8c46bb703b28ea481c28bc77f2595b32d5dacea9.zip |
iwlwifi: first enable RF kill interrupt, then check register
This can solve a race (very unlikely to happen though).
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans-pcie.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index 1d9724d45ae9..78aa3208bff9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c @@ -980,14 +980,13 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, return -EIO; } + iwl_enable_rfkill_int(trans); + /* If platform's RF_KILL switch is NOT set to KILL */ hw_rfkill = iwl_is_rfkill_set(trans); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); - - if (hw_rfkill) { - iwl_enable_rfkill_int(trans); + if (hw_rfkill) return -ERFKILL; - } iwl_write32(trans, CSR_INT, 0xFFFFFFFF); @@ -1560,15 +1559,14 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans) { bool hw_rfkill; + iwl_enable_rfkill_int(trans); + hw_rfkill = iwl_is_rfkill_set(trans); + iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); - if (hw_rfkill) - iwl_enable_rfkill_int(trans); - else + if (!hw_rfkill) iwl_enable_interrupts(trans); - iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); - return 0; } #endif /* CONFIG_PM_SLEEP */ |