diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch new file mode 100644 index 00000000..3fb9fae1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From 6fb488dec8482c866a2c7cd4d1da06b85b8b28c7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no> | ||
3 | Date: Mon, 2 Jul 2012 10:33:14 +0200 | ||
4 | Subject: [PATCH 031/109] USB: cdc-wdm: fix lockup on error in wdm_read | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | commit b086b6b10d9f182cd8d2f0dcfd7fd11edba93fc9 upstream. | ||
10 | |||
11 | Clear the WDM_READ flag on empty reads to avoid running | ||
12 | forever in an infinite tight loop, causing lockups: | ||
13 | |||
14 | Jul 1 21:58:11 nemi kernel: [ 3658.898647] qmi_wwan 2-1:1.2: Unexpected error -71 | ||
15 | Jul 1 21:58:36 nemi kernel: [ 3684.072021] BUG: soft lockup - CPU#0 stuck for 23s! [qmi.pl:12235] | ||
16 | Jul 1 21:58:36 nemi kernel: [ 3684.072212] CPU 0 | ||
17 | Jul 1 21:58:36 nemi kernel: [ 3684.072355] | ||
18 | Jul 1 21:58:36 nemi kernel: [ 3684.072367] Pid: 12235, comm: qmi.pl Tainted: P O 3.5.0-rc2+ #13 LENOVO 2776LEG/2776LEG | ||
19 | Jul 1 21:58:36 nemi kernel: [ 3684.072383] RIP: 0010:[<ffffffffa0635008>] [<ffffffffa0635008>] spin_unlock_irq+0x8/0xc [cdc_wdm] | ||
20 | Jul 1 21:58:36 nemi kernel: [ 3684.072388] RSP: 0018:ffff88022dca1e70 EFLAGS: 00000282 | ||
21 | Jul 1 21:58:36 nemi kernel: [ 3684.072393] RAX: ffff88022fc3f650 RBX: ffffffff811c56f7 RCX: 00000001000ce8c1 | ||
22 | Jul 1 21:58:36 nemi kernel: [ 3684.072398] RDX: 0000000000000010 RSI: 000000000267d810 RDI: ffff88022fc3f650 | ||
23 | Jul 1 21:58:36 nemi kernel: [ 3684.072403] RBP: ffff88022dca1eb0 R08: ffffffffa063578e R09: 0000000000000000 | ||
24 | Jul 1 21:58:36 nemi kernel: [ 3684.072407] R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000002 | ||
25 | Jul 1 21:58:36 nemi kernel: [ 3684.072412] R13: 0000000000000246 R14: ffffffff00000002 R15: ffff8802281d8c88 | ||
26 | Jul 1 21:58:36 nemi kernel: [ 3684.072418] FS: 00007f666a260700(0000) GS:ffff88023bc00000(0000) knlGS:0000000000000000 | ||
27 | Jul 1 21:58:36 nemi kernel: [ 3684.072423] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 | ||
28 | Jul 1 21:58:36 nemi kernel: [ 3684.072428] CR2: 000000000270d9d8 CR3: 000000022e865000 CR4: 00000000000007f0 | ||
29 | Jul 1 21:58:36 nemi kernel: [ 3684.072433] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 | ||
30 | Jul 1 21:58:36 nemi kernel: [ 3684.072438] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 | ||
31 | Jul 1 21:58:36 nemi kernel: [ 3684.072444] Process qmi.pl (pid: 12235, threadinfo ffff88022dca0000, task ffff88022ff76380) | ||
32 | Jul 1 21:58:36 nemi kernel: [ 3684.072448] Stack: | ||
33 | Jul 1 21:58:36 nemi kernel: [ 3684.072458] ffffffffa063592e 0000000100020000 ffff88022fc3f650 ffff88022fc3f6a8 | ||
34 | Jul 1 21:58:36 nemi kernel: [ 3684.072466] 0000000000000200 0000000100000000 000000000267d810 0000000000000000 | ||
35 | Jul 1 21:58:36 nemi kernel: [ 3684.072475] 0000000000000000 ffff880212cfb6d0 0000000000000200 ffff880212cfb6c0 | ||
36 | Jul 1 21:58:36 nemi kernel: [ 3684.072479] Call Trace: | ||
37 | Jul 1 21:58:36 nemi kernel: [ 3684.072489] [<ffffffffa063592e>] ? wdm_read+0x1a0/0x263 [cdc_wdm] | ||
38 | Jul 1 21:58:36 nemi kernel: [ 3684.072500] [<ffffffff8110adb7>] ? vfs_read+0xa1/0xfb | ||
39 | Jul 1 21:58:36 nemi kernel: [ 3684.072509] [<ffffffff81040589>] ? alarm_setitimer+0x35/0x64 | ||
40 | Jul 1 21:58:36 nemi kernel: [ 3684.072517] [<ffffffff8110aec7>] ? sys_read+0x45/0x6e | ||
41 | Jul 1 21:58:36 nemi kernel: [ 3684.072525] [<ffffffff813725f9>] ? system_call_fastpath+0x16/0x1b | ||
42 | Jul 1 21:58:36 nemi kernel: [ 3684.072557] Code: <66> 66 90 c3 83 ff ed 89 f8 74 16 7f 06 83 ff a1 75 0a c3 83 ff f4 | ||
43 | |||
44 | The WDM_READ flag is normally cleared by wdm_int_callback | ||
45 | before resubmitting the read urb, and set by wdm_in_callback | ||
46 | when this urb returns with data or an error. But a crashing | ||
47 | device may cause both a read error and cancelling all urbs. | ||
48 | Make sure that the flag is cleared by wdm_read if the buffer | ||
49 | is empty. | ||
50 | |||
51 | We don't clear the flag on errors, as there may be pending | ||
52 | data in the buffer which should be processed. The flag will | ||
53 | instead be cleared on the next wdm_read call. | ||
54 | |||
55 | Signed-off-by: Bjørn Mork <bjorn@mork.no> | ||
56 | Acked-by: Oliver Neukum <oneukum@suse.de> | ||
57 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
58 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
59 | --- | ||
60 | drivers/usb/class/cdc-wdm.c | 2 ++ | ||
61 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
62 | |||
63 | diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c | ||
64 | index 19fb5fa..9aaed0d 100644 | ||
65 | --- a/drivers/usb/class/cdc-wdm.c | ||
66 | +++ b/drivers/usb/class/cdc-wdm.c | ||
67 | @@ -473,6 +473,8 @@ retry: | ||
68 | goto retry; | ||
69 | } | ||
70 | if (!desc->reslength) { /* zero length read */ | ||
71 | + dev_dbg(&desc->intf->dev, "%s: zero length - clearing WDM_READ\n", __func__); | ||
72 | + clear_bit(WDM_READ, &desc->flags); | ||
73 | spin_unlock_irq(&desc->iuspin); | ||
74 | goto retry; | ||
75 | } | ||
76 | -- | ||
77 | 1.7.7.6 | ||
78 | |||