diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-07-03 03:25:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:10 -0400 |
commit | cd11acdd8542cb0c0fa7cd86590b1ba79d7e263a (patch) | |
tree | 0b3fd5ec340e05ea831fa24f46806350838bb296 /drivers/net/wireless | |
parent | a5b5bb9a053a973c23b867738c074acb3e80c0a0 (diff) |
[PATCH] lockdep: annotate hostap netdev ->xmit_lock
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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index b764cfda6e84..dafaa5ff5aa6 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -3095,6 +3095,14 @@ static void prism2_clear_set_tim_queue(local_info_t *local) | |||
3095 | } | 3095 | } |
3096 | 3096 | ||
3097 | 3097 | ||
3098 | /* | ||
3099 | * HostAP uses two layers of net devices, where the inner | ||
3100 | * layer gets called all the time from the outer layer. | ||
3101 | * This is a natural nesting, which needs a split lock type. | ||
3102 | */ | ||
3103 | static struct lock_class_key hostap_netdev_xmit_lock_key; | ||
3104 | |||
3105 | |||
3098 | static struct net_device * | 3106 | static struct net_device * |
3099 | prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, | 3107 | prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, |
3100 | struct device *sdev) | 3108 | struct device *sdev) |
@@ -3259,6 +3267,8 @@ while (0) | |||
3259 | SET_NETDEV_DEV(dev, sdev); | 3267 | SET_NETDEV_DEV(dev, sdev); |
3260 | if (ret >= 0) | 3268 | if (ret >= 0) |
3261 | ret = register_netdevice(dev); | 3269 | ret = register_netdevice(dev); |
3270 | |||
3271 | lockdep_set_class(&dev->_xmit_lock, &hostap_netdev_xmit_lock_key); | ||
3262 | rtnl_unlock(); | 3272 | rtnl_unlock(); |
3263 | if (ret < 0) { | 3273 | if (ret < 0) { |
3264 | printk(KERN_WARNING "%s: register netdevice failed!\n", | 3274 | printk(KERN_WARNING "%s: register netdevice failed!\n", |