aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2013-10-09 09:24:30 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-10-11 03:59:32 -0400
commitf39a52bfaf65de87a363d471ed02a3fef0752a1d (patch)
tree41e8ae9503ee9ce91c52a4df0d0f318098a05eeb
parent9439eac79f1edae172f7c54dce61c4fe2c8308ad (diff)
iwlwifi: don't WARN on bad firmware state
When we restart firmware and it is marked as not alive, we can still get calls from mac80211. Don't WARN on in this situation as this triggers automatic bug reports with no valuable information. This continuation of: commit 8ca95995e64f5d270889badb3e449dca91106a2b Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Date: Sun Sep 15 11:37:17 2013 +0300 iwlwifi: don't WARN on host commands sent when firmware is dead which remove WARN_ONCE from one place, but those warnings are also triggered from other functions. Patch also adds unlikely() statement. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> 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/iwl-trans.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 80b47508647c..c6bac7c90b00 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -601,7 +601,7 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans,
601{ 601{
602 int ret; 602 int ret;
603 603
604 if (trans->state != IWL_TRANS_FW_ALIVE) { 604 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) {
605 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state); 605 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
606 return -EIO; 606 return -EIO;
607 } 607 }
@@ -640,8 +640,8 @@ static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans,
640static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb, 640static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
641 struct iwl_device_cmd *dev_cmd, int queue) 641 struct iwl_device_cmd *dev_cmd, int queue)
642{ 642{
643 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, 643 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
644 "%s bad state = %d", __func__, trans->state); 644 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
645 645
646 return trans->ops->tx(trans, skb, dev_cmd, queue); 646 return trans->ops->tx(trans, skb, dev_cmd, queue);
647} 647}
@@ -649,16 +649,16 @@ static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
649static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue, 649static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue,
650 int ssn, struct sk_buff_head *skbs) 650 int ssn, struct sk_buff_head *skbs)
651{ 651{
652 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, 652 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
653 "%s bad state = %d", __func__, trans->state); 653 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
654 654
655 trans->ops->reclaim(trans, queue, ssn, skbs); 655 trans->ops->reclaim(trans, queue, ssn, skbs);
656} 656}
657 657
658static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue) 658static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue)
659{ 659{
660 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, 660 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
661 "%s bad state = %d", __func__, trans->state); 661 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
662 662
663 trans->ops->txq_disable(trans, queue); 663 trans->ops->txq_disable(trans, queue);
664} 664}
@@ -669,8 +669,8 @@ static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue,
669{ 669{
670 might_sleep(); 670 might_sleep();
671 671
672 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, 672 if (unlikely((trans->state != IWL_TRANS_FW_ALIVE)))
673 "%s bad state = %d", __func__, trans->state); 673 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
674 674
675 trans->ops->txq_enable(trans, queue, fifo, sta_id, tid, 675 trans->ops->txq_enable(trans, queue, fifo, sta_id, tid,
676 frame_limit, ssn); 676 frame_limit, ssn);
@@ -685,8 +685,8 @@ static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue,
685 685
686static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans) 686static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans)
687{ 687{
688 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, 688 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
689 "%s bad state = %d", __func__, trans->state); 689 IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
690 690
691 return trans->ops->wait_tx_queue_empty(trans); 691 return trans->ops->wait_tx_queue_empty(trans);
692} 692}