diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2009-05-11 11:36:39 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-05-11 18:35:48 -0400 |
commit | 705a76d2d22a2824f45f07d023a380293554e989 (patch) | |
tree | b28ca167ee7fd5a48fb5c09d2a143d711934a295 /drivers/input/touchscreen | |
parent | 9166d0f620d5dd4a128711bdeedb3e0f534d9d49 (diff) |
Input: tsc2007 - fix locking in hrtimer handler
Now that hrtimers are always running in hard irq context we can't
unconditionally enable interrupts at the end of the timer function.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Kwangwoo Lee <kwangwoo.lee@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/tsc2007.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 536668fbda22..948e167557f1 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
@@ -200,8 +200,9 @@ static int tsc2007_read_values(struct tsc2007 *tsc) | |||
200 | static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle) | 200 | static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle) |
201 | { | 201 | { |
202 | struct tsc2007 *ts = container_of(handle, struct tsc2007, timer); | 202 | struct tsc2007 *ts = container_of(handle, struct tsc2007, timer); |
203 | unsigned long flags; | ||
203 | 204 | ||
204 | spin_lock_irq(&ts->lock); | 205 | spin_lock_irqsave(&ts->lock, flags); |
205 | 206 | ||
206 | if (unlikely(!ts->get_pendown_state() && ts->pendown)) { | 207 | if (unlikely(!ts->get_pendown_state() && ts->pendown)) { |
207 | struct input_dev *input = ts->input; | 208 | struct input_dev *input = ts->input; |
@@ -222,7 +223,7 @@ static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle) | |||
222 | tsc2007_send_event(ts); | 223 | tsc2007_send_event(ts); |
223 | } | 224 | } |
224 | 225 | ||
225 | spin_unlock_irq(&ts->lock); | 226 | spin_unlock_irqrestore(&ts->lock, flags); |
226 | 227 | ||
227 | return HRTIMER_NORESTART; | 228 | return HRTIMER_NORESTART; |
228 | } | 229 | } |