summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@nokia.com>2009-02-12 15:09:47 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 16:20:35 -0700
commitb2bdf3a789162aa6ff9c6f139bee9cc7954bc5b4 (patch)
tree968f45c9df70a157b6a6a34c7f833fed8a5a9bb2 /drivers/usb
parent6da9c99059bf24fb1faae6b9613bae64ea50c05e (diff)
downloadop-kernel-dev-b2bdf3a789162aa6ff9c6f139bee9cc7954bc5b4.zip
op-kernel-dev-b2bdf3a789162aa6ff9c6f139bee9cc7954bc5b4.tar.gz
USB: composite: avoid inconsistent lock state
Avoid the following INFO from lock debugging: [ 369.126112] ================================= [ 369.132063] [ INFO: inconsistent lock state ] [ 369.136457] 2.6.28-maemo1 #1 [ 369.139387] --------------------------------- [ 369.143782] inconsistent {hardirq-on-W} -> {in-hardirq-W} usage. [ 369.149855] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes: [ 369.154890] (&cdev->lock){+-..}, at: [<bf1979f0>] composite_disconnect+0x1c/0] [ 369.163404] {hardirq-on-W} state was registered at: [ 369.168348] [<c00788a8>] __lock_acquire+0x5d0/0x7d8 [ 369.173506] [<c0078b14>] lock_acquire+0x64/0x78 [ 369.178266] [<c0263a34>] _spin_lock+0x4c/0x80 [ 369.182905] [<bf19597c>] usb_function_deactivate+0x20/0x70 [g_nokia] [ 369.189527] [<bf1a0a88>] 0xbf1a0a88 [ 369.193281] [<bf19f450>] 0xbf19f450 [ 369.197004] [<bf19fa3c>] 0xbf19fa3c [ 369.200758] [<bf1a03a0>] 0xbf1a03a0 [ 369.204481] [<bf19f254>] 0xbf19f254 [ 369.208204] [<bf1a0158>] 0xbf1a0158 [ 369.211927] [<bf1a130c>] 0xbf1a130c [ 369.215650] [<c01c21f0>] usb_gadget_register_driver+0x12c/0x28c [ 369.221846] [<bf1a06bc>] 0xbf1a06bc [ 369.225569] [<bf1a06e8>] 0xbf1a06e8 [ 369.229322] [<c002c2dc>] __exception_text_end+0x64/0x19c [ 369.234877] [<c0081628>] sys_init_module+0x9c/0x194 [ 369.240004] [<c002c8e0>] ret_fast_syscall+0x0/0x2c [ 369.245039] [<ffffffff>] 0xffffffff [ 369.248793] irq event stamp: 218356 [ 369.252302] hardirqs last enabled at (218355): [<c003a77c>] omap3_enter_idle+8 [ 369.260420] hardirqs last disabled at (218356): [<c0264774>] __irq_svc+0x34/0x0 [ 369.267927] softirqs last enabled at (218348): [<c00585a4>] __do_softirq+0x134 [ 369.275892] softirqs last disabled at (218335): [<c005899c>] irq_exit+0x60/0xb0 [ 369.283308] [ 369.283308] other info that might help us debug this: [ 369.289930] no locks held by swapper/0. Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/composite.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 5d11c29..40f1da7 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -149,16 +149,17 @@ done:
int usb_function_deactivate(struct usb_function *function)
{
struct usb_composite_dev *cdev = function->config->cdev;
+ unsigned long flags;
int status = 0;
- spin_lock(&cdev->lock);
+ spin_lock_irqsave(&cdev->lock, flags);
if (cdev->deactivations == 0)
status = usb_gadget_disconnect(cdev->gadget);
if (status == 0)
cdev->deactivations++;
- spin_unlock(&cdev->lock);
+ spin_unlock_irqrestore(&cdev->lock, flags);
return status;
}
OpenPOWER on IntegriCloud