Commit 289e5501 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg

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: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent da0cabb8
...@@ -897,6 +897,7 @@ static int iwl_set_hw_ready(struct iwl_trans *trans) ...@@ -897,6 +897,7 @@ static int iwl_set_hw_ready(struct iwl_trans *trans)
static int iwl_prepare_card_hw(struct iwl_trans *trans) static int iwl_prepare_card_hw(struct iwl_trans *trans)
{ {
int ret; int ret;
int t = 0;
IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); 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) ...@@ -909,17 +910,15 @@ static int iwl_prepare_card_hw(struct iwl_trans *trans)
iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_PREPARE); CSR_HW_IF_CONFIG_REG_PREPARE);
ret = iwl_poll_bit(trans, CSR_HW_IF_CONFIG_REG, do {
~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE,
CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000);
if (ret < 0)
return ret;
/* HW should be ready by now, check again. */
ret = iwl_set_hw_ready(trans); ret = iwl_set_hw_ready(trans);
if (ret >= 0) if (ret >= 0)
return 0; return 0;
usleep_range(200, 1000);
t += 200;
} while (t < 150000);
return ret; return ret;
} }
......
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