[PATCH 1/2] Input: tsc2007: fix locking method against the

From: Kwangwoo Lee
Date: Mon May 11 2009 - 07:00:01 EST


Without this patch, current driver will emit panic message below:
Kernel panic - not syncing: Fatal exception in interrupt.

The original patch is written by Thierry.

Signed-off-by: Thierry Reding <thierry.reding@xxxxxxxxxxxxxxxxx>
Signed-off-by: Kwangwoo Lee <kwangwoo.lee@xxxxxxxxx>
---
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 536668f..948e167 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)
static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
{
struct tsc2007 *ts = container_of(handle, struct tsc2007, timer);
+ unsigned long flags;

- spin_lock_irq(&ts->lock);
+ spin_lock_irqsave(&ts->lock, flags);

if (unlikely(!ts->get_pendown_state() && ts->pendown)) {
struct input_dev *input = ts->input;
@@ -222,7 +223,7 @@ static enum hrtimer_restart tsc2007_timer(struct
hrtimer *handle)
tsc2007_send_event(ts);
}

- spin_unlock_irq(&ts->lock);
+ spin_unlock_irqrestore(&ts->lock, flags);

return HRTIMER_NORESTART;
}
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/