diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-08-05 16:55:06 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-08-21 18:31:27 +0200 |
commit | 289e5501c3141191dd830957f1d764d3dc14a54f (patch) | |
tree | 41b802ef568f2689e93bae4595fb39c50551b50b | |
parent | da0cabb8de68d9dba254810f65aa7146eb5f47b3 (diff) | |
download | linux-289e5501c3141191dd830957f1d764d3dc14a54f.tar.bz2 |
iwlwifi: fix the preparation of the card
There is no need to check if the ownership has been
relinquished but we should rather try to get it in a
loop.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index f981b7387292..f76efac230e2 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c @@ -897,6 +897,7 @@ static int iwl_set_hw_ready(struct iwl_trans *trans) static int iwl_prepare_card_hw(struct iwl_trans *trans) { int ret; + int t = 0; IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); @@ -909,17 +910,15 @@ static int iwl_prepare_card_hw(struct iwl_trans *trans) iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, CSR_HW_IF_CONFIG_REG_PREPARE); - ret = iwl_poll_bit(trans, CSR_HW_IF_CONFIG_REG, - ~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, - CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000); + do { + ret = iwl_set_hw_ready(trans); + if (ret >= 0) + return 0; - if (ret < 0) - return ret; + usleep_range(200, 1000); + t += 200; + } while (t < 150000); - /* HW should be ready by now, check again. */ - ret = iwl_set_hw_ready(trans); - if (ret >= 0) - return 0; return ret; } |