lkml.org 
[lkml]   [2006]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] lockdep, annotate slocks: turn lockdep off for them
On 7/1/06, Arjan van de Ven <arjan@infradead.org> wrote:
> 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",

(Sorry for the duplicate message Arjan, I forgot to Reply All the first time.)

After rebuilding with this patch, I still get the lockdep message.
Everything is the same except now the "other info" section reads:

other info that might help us debug this:

1 lock held by swapper/0:
#0: (&dev->_xmit_lock){-+..}, at: [<c11a5118>] dev_queue_xmit+0x183/0x24b
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-02 00:10    [W:0.106 / U:3.748 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site