linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kernel freezes when insmoding iwldvm.ko from backports-20140117
@ 2014-01-19 20:52 Hauke Mehrtens
  2014-01-20  8:08 ` Emmanuel Grumbach
  0 siblings, 1 reply; 2+ messages in thread
From: Hauke Mehrtens @ 2014-01-19 20:52 UTC (permalink / raw)
  To: backports@vger.kernel.org, Emmanuel Grumbach,
	linux-wireless@vger.kernel.org

Hi,

when I insmoding iwldvm.ko from backports-201400117 my kernel freezes
and does not show any error message. This problem started with
backports-20140106, backports-20131224 works for me.

I am using the Ubuntu kernel 3.5.0-45 someone else with the same problem
uses kernel 3.2.0. I am using a Intel 6300.
Someone reported that an Atheros card worked, so this is probably a
problem in iwlwifi.

Hauke

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kernel freezes when insmoding iwldvm.ko from backports-20140117
  2014-01-19 20:52 kernel freezes when insmoding iwldvm.ko from backports-20140117 Hauke Mehrtens
@ 2014-01-20  8:08 ` Emmanuel Grumbach
  0 siblings, 0 replies; 2+ messages in thread
From: Emmanuel Grumbach @ 2014-01-20  8:08 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: backports@vger.kernel.org, Emmanuel Grumbach,
	linux-wireless@vger.kernel.org, ilw@linux.intel.com

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

On Sun, Jan 19, 2014 at 10:52 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> Hi,
>
> when I insmoding iwldvm.ko from backports-201400117 my kernel freezes
> and does not show any error message. This problem started with
> backports-20140106, backports-20131224 works for me.
>
> I am using the Ubuntu kernel 3.5.0-45 someone else with the same problem
> uses kernel 3.2.0. I am using a Intel 6300.
> Someone reported that an Atheros card worked, so this is probably a
> problem in iwlwifi.
>

patch attached

[-- Attachment #2: 0001-iwlwifi-pcie-don-t-panic-on-host-commands-in-iwldvm.patch --]
[-- Type: text/x-patch, Size: 2031 bytes --]

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-20  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-19 20:52 kernel freezes when insmoding iwldvm.ko from backports-20140117 Hauke Mehrtens
2014-01-20  8:08 ` Emmanuel Grumbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).