summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch
new file mode 100644
index 0000000000..5cb7bcb065
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch
@@ -0,0 +1,76 @@
1From 83eb44b1c84f99d9a5c67612bd94b4ed7c43f64c Mon Sep 17 00:00:00 2001
2From: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
3Date: Tue, 24 Mar 2009 17:22:49 -0700
4Subject: [PATCH] USB: composite: avoid inconsistent lock state
5
6Avoid the following INFO from lock debugging:
7
8[ 369.126112] =================================
9[ 369.132063] [ INFO: inconsistent lock state ]
10[ 369.136457] 2.6.28-maemo1 #1
11[ 369.139387] ---------------------------------
12[ 369.143782] inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
13[ 369.149855] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
14[ 369.154890] (&cdev->lock){+-..}, at: [<bf1979f0>] composite_disconnect+0x1c/0]
15[ 369.163404] {hardirq-on-W} state was registered at:
16[ 369.168348] [<c00788a8>] __lock_acquire+0x5d0/0x7d8
17[ 369.173506] [<c0078b14>] lock_acquire+0x64/0x78
18[ 369.178266] [<c0263a34>] _spin_lock+0x4c/0x80
19[ 369.182905] [<bf19597c>] usb_function_deactivate+0x20/0x70 [g_nokia]
20[ 369.189527] [<bf1a0a88>] 0xbf1a0a88
21[ 369.193281] [<bf19f450>] 0xbf19f450
22[ 369.197004] [<bf19fa3c>] 0xbf19fa3c
23[ 369.200758] [<bf1a03a0>] 0xbf1a03a0
24[ 369.204481] [<bf19f254>] 0xbf19f254
25[ 369.208204] [<bf1a0158>] 0xbf1a0158
26[ 369.211927] [<bf1a130c>] 0xbf1a130c
27[ 369.215650] [<c01c21f0>] usb_gadget_register_driver+0x12c/0x28c
28[ 369.221846] [<bf1a06bc>] 0xbf1a06bc
29[ 369.225569] [<bf1a06e8>] 0xbf1a06e8
30[ 369.229322] [<c002c2dc>] __exception_text_end+0x64/0x19c
31[ 369.234877] [<c0081628>] sys_init_module+0x9c/0x194
32[ 369.240004] [<c002c8e0>] ret_fast_syscall+0x0/0x2c
33[ 369.245039] [<ffffffff>] 0xffffffff
34[ 369.248793] irq event stamp: 218356
35[ 369.252302] hardirqs last enabled at (218355): [<c003a77c>] omap3_enter_idle+8
36[ 369.260420] hardirqs last disabled at (218356): [<c0264774>] __irq_svc+0x34/0x0
37[ 369.267927] softirqs last enabled at (218348): [<c00585a4>] __do_softirq+0x134
38[ 369.275892] softirqs last disabled at (218335): [<c005899c>] irq_exit+0x60/0xb0
39[ 369.283308]
40[ 369.283308] other info that might help us debug this:
41[ 369.289930] no locks held by swapper/0.
42
43Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
44Signed-off-by: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
45Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
46---
47 drivers/usb/gadget/composite.c | 5 +++--
48 1 files changed, 3 insertions(+), 2 deletions(-)
49
50diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
51index 5d11c29..40f1da7 100644
52--- a/drivers/usb/gadget/composite.c
53+++ b/drivers/usb/gadget/composite.c
54@@ -149,16 +149,17 @@ done:
55 int usb_function_deactivate(struct usb_function *function)
56 {
57 struct usb_composite_dev *cdev = function->config->cdev;
58+ unsigned long flags;
59 int status = 0;
60
61- spin_lock(&cdev->lock);
62+ spin_lock_irqsave(&cdev->lock, flags);
63
64 if (cdev->deactivations == 0)
65 status = usb_gadget_disconnect(cdev->gadget);
66 if (status == 0)
67 cdev->deactivations++;
68
69- spin_unlock(&cdev->lock);
70+ spin_unlock_irqrestore(&cdev->lock, flags);
71 return status;
72 }
73
74--
751.6.0.4
76