aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-10-23 01:53:21 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-10-23 14:21:49 -0400
commit7f2ac8fb31896c9fb70dbd2a2e6642b79996fc13 (patch)
tree1da1512e519e3fc0c20c55050dd93454586bf2f7
parent1ffde699aae127e7abdb98dbdedc2cc6a973a1a1 (diff)
iwlwifi: pcie: fix polling in various places
iwl_poll_bit may return a strictly positive value when the poll doesn't match on the first try. This was caught when WoWLAN started failing upon resume even if the poll_bit actually succeeded. Also change a wrong print. If we reach the end of iwl_pcie_prepare_card_hw, it means that we couldn't get the devices. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index c706dba67cdd..3781b029e54a 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -430,7 +430,7 @@ static int iwl_pcie_apm_stop_master(struct iwl_trans *trans)
430 ret = iwl_poll_bit(trans, CSR_RESET, 430 ret = iwl_poll_bit(trans, CSR_RESET,
431 CSR_RESET_REG_FLAG_MASTER_DISABLED, 431 CSR_RESET_REG_FLAG_MASTER_DISABLED,
432 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); 432 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
433 if (ret) 433 if (ret < 0)
434 IWL_WARN(trans, "Master Disable Timed Out, 100 usec\n"); 434 IWL_WARN(trans, "Master Disable Timed Out, 100 usec\n");
435 435
436 IWL_DEBUG_INFO(trans, "stop master\n"); 436 IWL_DEBUG_INFO(trans, "stop master\n");
@@ -546,7 +546,7 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans)
546 msleep(25); 546 msleep(25);
547 } 547 }
548 548
549 IWL_DEBUG_INFO(trans, "got NIC after %d iterations\n", iter); 549 IWL_ERR(trans, "Couldn't prepare the card\n");
550 550
551 return ret; 551 return ret;
552} 552}
@@ -1045,7 +1045,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
1045 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 1045 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
1046 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 1046 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
1047 25000); 1047 25000);
1048 if (ret) { 1048 if (ret < 0) {
1049 IWL_ERR(trans, "Failed to resume the device (mac ready)\n"); 1049 IWL_ERR(trans, "Failed to resume the device (mac ready)\n");
1050 return ret; 1050 return ret;
1051 } 1051 }