diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0013-uwb-fix-use-of-del_timer_sync-in-interrupt.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0013-uwb-fix-use-of-del_timer_sync-in-interrupt.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0013-uwb-fix-use-of-del_timer_sync-in-interrupt.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0013-uwb-fix-use-of-del_timer_sync-in-interrupt.patch new file mode 100644 index 00000000..0fbd2366 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0013-uwb-fix-use-of-del_timer_sync-in-interrupt.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 73b80f793567a6056f9265c82599b47bc5856db8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Oliver Neukum <oliver@neukum.org> | ||
3 | Date: Mon, 16 Apr 2012 15:28:28 +0200 | ||
4 | Subject: [PATCH 013/165] uwb: fix use of del_timer_sync() in interrupt | ||
5 | |||
6 | commit 9426cd05682745d1024dbabdec5631309bd2f480 upstream. | ||
7 | |||
8 | del_timer_sync() cannot be used in interrupt. | ||
9 | Replace it with del_timer() and a flag | ||
10 | |||
11 | Signed-off-by: Oliver Neukum <oneukum@suse.de> | ||
12 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | drivers/uwb/neh.c | 12 +++++++++++- | ||
16 | 1 files changed, 11 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/drivers/uwb/neh.c b/drivers/uwb/neh.c | ||
19 | index a269937..8cb71bb 100644 | ||
20 | --- a/drivers/uwb/neh.c | ||
21 | +++ b/drivers/uwb/neh.c | ||
22 | @@ -107,6 +107,7 @@ struct uwb_rc_neh { | ||
23 | u8 evt_type; | ||
24 | __le16 evt; | ||
25 | u8 context; | ||
26 | + u8 completed; | ||
27 | uwb_rc_cmd_cb_f cb; | ||
28 | void *arg; | ||
29 | |||
30 | @@ -409,6 +410,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size | ||
31 | struct device *dev = &rc->uwb_dev.dev; | ||
32 | struct uwb_rc_neh *neh; | ||
33 | struct uwb_rceb *notif; | ||
34 | + unsigned long flags; | ||
35 | |||
36 | if (rceb->bEventContext == 0) { | ||
37 | notif = kmalloc(size, GFP_ATOMIC); | ||
38 | @@ -422,7 +424,11 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size | ||
39 | } else { | ||
40 | neh = uwb_rc_neh_lookup(rc, rceb); | ||
41 | if (neh) { | ||
42 | - del_timer_sync(&neh->timer); | ||
43 | + spin_lock_irqsave(&rc->neh_lock, flags); | ||
44 | + /* to guard against a timeout */ | ||
45 | + neh->completed = 1; | ||
46 | + del_timer(&neh->timer); | ||
47 | + spin_unlock_irqrestore(&rc->neh_lock, flags); | ||
48 | uwb_rc_neh_cb(neh, rceb, size); | ||
49 | } else | ||
50 | dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n", | ||
51 | @@ -568,6 +574,10 @@ static void uwb_rc_neh_timer(unsigned long arg) | ||
52 | unsigned long flags; | ||
53 | |||
54 | spin_lock_irqsave(&rc->neh_lock, flags); | ||
55 | + if (neh->completed) { | ||
56 | + spin_unlock_irqrestore(&rc->neh_lock, flags); | ||
57 | + return; | ||
58 | + } | ||
59 | if (neh->context) | ||
60 | __uwb_rc_neh_rm(rc, neh); | ||
61 | else | ||
62 | -- | ||
63 | 1.7.7.6 | ||
64 | |||