diff mbox

iwldvm: wireles-testing 3.13.0-rc7 system freeze

Message ID CANUX_P0XtpyGhUmm4poCWpYpgEZ2hvxnBod3O6cCL996xbcOgg@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Emmanuel Grumbach Jan. 20, 2014, 8:07 a.m. UTC
On Fri, Jan 10, 2014 at 10:03 PM, Janusz Dziedzic
<janusz.dziedzic@gmail.com> wrote:
> Seems there is a system freeze with latest wireless-testing and iwldvm
> driver after iface up.
>

patch attached

Comments

Janusz Dziedzic Jan. 20, 2014, 8:49 a.m. UTC | #1
2014/1/20 Emmanuel Grumbach <egrumbach@gmail.com>:
> On Fri, Jan 10, 2014 at 10:03 PM, Janusz Dziedzic
> <janusz.dziedzic@gmail.com> wrote:
>> Seems there is a system freeze with latest wireless-testing and iwldvm
>> driver after iface up.
>>
>
> patch attached

 Thanks, works correctly now.

BR
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 281e6beddf3d46661b6c1dd7a4dedfde78bdf6ed Mon Sep 17 00:00:00 2001
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date: Mon, 20 Jan 2014 09:50:29 +0200
Subject: [PATCH] iwlwifi: pcie: don't panic on host commands in iwldvm

My commit:

None of the devices supported by iwldvm have support for
shadow registers. This means that we wake the NIC when we
send host commands when we increment the write pointer on
the host commands ring. This happened even before my bad
commit mentionned below.
Since my commit below, we wake up the NIC regardless of
shadow register support. This means that in iwldvm (when
the NIC doesn't support shadow register), we wake up the
NIC twice:

pcie_enqueue_hcmd:
	wake up the NIC
	iwl_pcie_txq_inc_wr_ptr:
		wake up the NIC - no shadow reg support

Since waking up the NIC means that we need to a spinlock,
this obviously leads to a recursive spinlock and hence a
freeze.

Fixes: b9439491055a ("iwlwifi: pcie: keep the NIC awake when commands are in flight")
Reported-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/pcie/tx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index 270509e..0b1a93e 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -294,13 +294,14 @@  static void iwl_pcie_txq_inval_byte_cnt_tbl(struct iwl_trans *trans,
  */
 void iwl_pcie_txq_inc_wr_ptr(struct iwl_trans *trans, struct iwl_txq *txq)
 {
+	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 	u32 reg = 0;
 	int txq_id = txq->q.id;
 
 	if (txq->need_update == 0)
 		return;
 
-	if (trans->cfg->base_params->shadow_reg_enable) {
+	if (trans->cfg->base_params->shadow_reg_enable || txq_id == trans_pcie->cmd_queue) {
 		/* shadow register enabled */
 		iwl_write32(trans, HBUS_TARG_WRPTR,
 			    txq->q.write_ptr | (txq_id << 8));
-- 
1.8.3.2