mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Miles Lane <miles.lane@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch] lockdep, annotate slocks: turn lockdep off for them
Date: Sat, 01 Jul 2006 11:41:06 +0200	[thread overview]
Message-ID: <1151746867.3195.19.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <a44ae5cd0606301545s33496174lcd7136d8bf41897@mail.gmail.com>

On Fri, 2006-06-30 at 15:45 -0700, Miles Lane wrote:
> Okay, I rebuilt my kernel with your combo patch applied.
> Then, I inserted my US Robotics USR2210 PCMCIA wifi card,
> ran "pccardutil eject", popped out the card and then inserted
> a Compaq iPaq wifi card.  This triggered the following.
> 
> [ INFO: possible circular locking dependency detected ]
> -------------------------------------------------------
> syslogd/1886 is trying to acquire lock:
>  (&dev->queue_lock){-+..}, at: [<c11a50b5>] dev_queue_xmit+0x120/0x24b
> 
> but task is already holding lock:
>  (&dev->_xmit_lock){-+..}, at: [<c11a5118>] dev_queue_xmit+0x183/0x24b
> 
> which lock already depends on the new lock.


ok this appears to be hostap playing games... it has 2 network devices
for one piece of hardware and one calls the other via the networking
layer; there is thankfully a natural ordering between the two, so just
making the slave one a separate type ought to make this work.

Can you test the patch below?

---
 drivers/net/wireless/hostap/hostap_hw.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: linux-2.6.17-mm4/drivers/net/wireless/hostap/hostap_hw.c
===================================================================
--- linux-2.6.17-mm4.orig/drivers/net/wireless/hostap/hostap_hw.c
+++ linux-2.6.17-mm4/drivers/net/wireless/hostap/hostap_hw.c
@@ -3096,6 +3096,14 @@ static void prism2_clear_set_tim_queue(l
 }
 
 
+/*
+ * HostAP uses two layers of net devices, where the inner
+ * layer gets called all the time from the outer layer.
+ * This is a natural nesting, which needs a split lock type.
+ */
+static struct lock_class_key hostap_netdev_xmit_lock_key;
+
+
 static struct net_device *
 prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
 		       struct device *sdev)
@@ -3260,6 +3268,8 @@ while (0)
 	SET_NETDEV_DEV(dev, sdev);
 	if (ret >= 0)
 		ret = register_netdevice(dev);
+
+	lockdep_set_class(&dev->_xmit_lock, &hostap_netdev_xmit_lock_key);
 	rtnl_unlock();
 	if (ret < 0) {
 		printk(KERN_WARNING "%s: register netdevice failed!\n",



  parent reply	other threads:[~2006-07-01  9:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 19:01 2.6.17-mm3 -- BUG: illegal lock usage -- illegal {softirq-on-W} -> {in-softirq-R} usage Miles Lane
2006-06-29 19:26 ` Andrew Morton
2006-06-29 19:42   ` Arjan van de Ven
2006-06-29 19:56     ` Andrew Morton
2006-06-30  2:57       ` Herbert Xu
2006-06-30  6:50 ` Ingo Molnar
2006-06-30  6:59   ` Ingo Molnar
2006-06-30  7:22   ` [patch] lockdep, annotate slocks: turn lockdep off for them Ingo Molnar
2006-06-30  9:18     ` Ingo Molnar
2006-06-30 11:17       ` Herbert Xu
2006-06-30 11:37         ` Ingo Molnar
2006-06-30 11:46           ` Herbert Xu
2006-06-30 20:21           ` Miles Lane
2006-06-30 20:38             ` Ingo Molnar
2006-06-30 22:45               ` Miles Lane
2006-07-01  0:14                 ` Miles Lane
2006-07-01  5:32                 ` Ingo Molnar
2006-07-01  9:41                 ` Arjan van de Ven [this message]
2006-07-01 14:06                   ` Miles Lane
2006-07-01 14:07                     ` Herbert Xu
2006-07-01 14:10                       ` Miles Lane
2006-07-01 14:19                         ` Miles Lane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1151746867.3195.19.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=akpm@osdl.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles.lane@gmail.com \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®