[kernel/f18] Don't trigger a stack trace on crashing iwlwifi firmware (rhbz 896695)

Josh Boyer jwboyer at fedoraproject.org
Wed Oct 9 14:30:15 UTC 2013


commit 9f379b4ef15096e3e581e2f47b6f6fc4435e7db7
Author: Josh Boyer <jwboyer at fedoraproject.org>
Date:   Wed Oct 9 10:28:35 2013 -0400

    Don't trigger a stack trace on crashing iwlwifi firmware (rhbz 896695)

 ...-t-WARN-on-host-commands-sent-when-firmwa.patch |   35 +++++++
 ...-iwlwifi-don-t-WARN-on-bad-firmware-state.patch |   98 ++++++++++++++++++++
 kernel.spec                                        |    9 ++
 3 files changed, 142 insertions(+), 0 deletions(-)
---
diff --git a/0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch b/0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch
new file mode 100644
index 0000000..241b7d7
--- /dev/null
+++ b/0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch
@@ -0,0 +1,35 @@
+From 8ca95995e64f5d270889badb3e449dca91106a2b Mon Sep 17 00:00:00 2001
+From: Emmanuel Grumbach <emmanuel.grumbach at intel.com>
+Date: Sun, 15 Sep 2013 11:37:17 +0300
+Subject: [PATCH] iwlwifi: don't WARN on host commands sent when firmware is dead
+
+This triggers automatic bug reports and add no valuable
+information. Print a simple error instead and drop the
+host command.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach at intel.com>
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+ drivers/net/wireless/iwlwifi/iwl-trans.h |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
+index dd57a36..80b4750 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
++++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
+@@ -601,8 +601,10 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans,
+ {
+ 	int ret;
+ 
+-	WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
+-		  "%s bad state = %d", __func__, trans->state);
++	if (trans->state != IWL_TRANS_FW_ALIVE) {
++		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
++		return -EIO;
++	}
+ 
+ 	if (!(cmd->flags & CMD_ASYNC))
+ 		lock_map_acquire_read(&trans->sync_cmd_lockdep_map);
+-- 
+1.7.1
+
diff --git a/0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch b/0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch
new file mode 100644
index 0000000..499c34a
--- /dev/null
+++ b/0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch
@@ -0,0 +1,98 @@
+From 3efd689c41080b0d4a9cc263a51f2868e3d5a37b Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka at redhat.com>
+Date: Wed, 9 Oct 2013 15:03:57 +0200
+Subject: [PATCH] iwlwifi: don't WARN on bad firmware state
+
+When we restart firmware is possible and hance firmware 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 extend change from:
+
+commit 8ca95995e64f5d270889badb3e449dca91106a2b
+Author: Emmanuel Grumbach <emmanuel.grumbach at 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 adds also unlikely() statement.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
+---
+ drivers/net/wireless/iwlwifi/iwl-trans.h |   22 +++++++++++-----------
+ 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 80b4750..c6bac7c 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,
+ {
+ 	int ret;
+ 
+-	if (trans->state != IWL_TRANS_FW_ALIVE) {
++	if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) {
+ 		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+ 		return -EIO;
+ 	}
+@@ -640,8 +640,8 @@ static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans,
+ static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
+ 			       struct iwl_device_cmd *dev_cmd, int queue)
+ {
+-	WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
+-		  "%s bad state = %d", __func__, trans->state);
++	if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
++		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+ 
+ 	return trans->ops->tx(trans, skb, dev_cmd, queue);
+ }
+@@ -649,16 +649,16 @@ static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
+ static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue,
+ 				     int ssn, struct sk_buff_head *skbs)
+ {
+-	WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
+-		  "%s bad state = %d", __func__, trans->state);
++	if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
++		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+ 
+ 	trans->ops->reclaim(trans, queue, ssn, skbs);
+ }
+ 
+ static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue)
+ {
+-	WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
+-		  "%s bad state = %d", __func__, trans->state);
++	if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
++		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+ 
+ 	trans->ops->txq_disable(trans, queue);
+ }
+@@ -669,8 +669,8 @@ static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue,
+ {
+ 	might_sleep();
+ 
+-	WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
+-		  "%s bad state = %d", __func__, trans->state);
++	if (unlikely((trans->state != IWL_TRANS_FW_ALIVE)))
++		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+ 
+ 	trans->ops->txq_enable(trans, queue, fifo, sta_id, tid,
+ 				 frame_limit, ssn);
+@@ -685,8 +685,8 @@ static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue,
+ 
+ static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans)
+ {
+-	WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
+-		  "%s bad state = %d", __func__, trans->state);
++	if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
++		IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+ 
+ 	return trans->ops->wait_tx_queue_empty(trans);
+ }
+-- 
+1.7.1
+
diff --git a/kernel.spec b/kernel.spec
index f5dc4bd..76031f3 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -782,6 +782,10 @@ Patch25124: drm-nouveau-bios-init-stub-opcode-0xaa.patch
 #rhbz 998732
 Patch25125: vfio-iommu-Fixed-interaction-of-VFIO_IOMMU_MAP_DMA.patch
 
+#rhbz 896695
+Patch25126: 0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch
+Patch25127: 0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch
+
 # END OF PATCH DEFINITIONS
 
 %endif
@@ -1501,6 +1505,10 @@ ApplyPatch drm-nouveau-bios-init-stub-opcode-0xaa.patch
 #rhbz 998732
 ApplyPatch vfio-iommu-Fixed-interaction-of-VFIO_IOMMU_MAP_DMA.patch
 
+#rhbz 896695
+ApplyPatch 0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch
+ApplyPatch 0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2343,6 +2351,7 @@ fi
 #                 ||     ||
 %changelog
 * Wed Oct 09 2013 Josh Boyer <jwboyer at fedoraproject.org>
+- Don't trigger a stack trace on crashing iwlwifi firmware (rhbz 896695)
 - Add patch to fix VFIO IOMMU crash (rhbz 998732)
 
 * Tue Oct 08 2013 Josh Boyer <jwboyer at fedoraproject.org>


More information about the scm-commits mailing list