diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2011-04-07 08:44:04 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-04-07 08:44:04 +0100 |
commit | 86a249ed5354c7eff6a702f9d5688cea029aed7c (patch) | |
tree | 0ea4b3dcd50338f07764693f42f09c883969b848 | |
parent | 3c817f455f5544f94ca0e908ca161f4c8be68d68 (diff) |
touchscreen: Fix BUG: using smp_processor_id() in preemptible code
touchscreen: Fix BUG: using smp_processor_id() in preemptible code
This patch fixes the below preempt leak
Backtrace:
[<c00365b4>] (dump_backtrace+0x0/0x110) from [<c0357b78>] (dump_stack+0x18/0x1c)
r7:cfae6a20 r6:c0260d28 r5:00000000 r4:cfab4000
[<c0357b60>] (dump_stack+0x0/0x1c) from [<c01dbe24>] (debug_smp_processor_id+0xc0/0xf0)
[<c01dbd64>] (debug_smp_processor_id+0x0/0xf0) from [<c0260d28>] (syn_isr_work+0x2c/0x314)
r7:cfae6a20 r6:cfae6a20 r5:cfab4000 r4:cf96b520
[<c0260cfc>] (syn_isr_work+0x0/0x314) from [<c0071fc8>] (worker_thread+0x1d8/0x270)
[<c0071df0>] (worker_thread+0x0/0x270) from [<c0076410>] (kthread+0x88/0x90)
[<c0076388>] (kthread+0x0/0x90) from [<c0062218>] (do_exit+0x0/0x664)
r7:00000000 r6:00000000 r5:00000000 r4:00000000
BUG: using smp_processor_id() in preemptible [00000000] code: tm12xx_wq/413
caller is syn_isr_work+0x1a4/0x314
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Abraham Arce <x0066660@ti.com>
-rw-r--r-- | drivers/input/touchscreen/syntm12xx.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/syntm12xx.c b/drivers/input/touchscreen/syntm12xx.c index 2979fbad919..00ec0f071a9 100644 --- a/drivers/input/touchscreen/syntm12xx.c +++ b/drivers/input/touchscreen/syntm12xx.c @@ -1001,8 +1001,10 @@ static void syn_isr_work(struct work_struct *work) mutex_lock(&sd->lock); - if (sd->f_measure) - sd->ts_work = cpu_clock(smp_processor_id()); + if (sd->f_measure) { + sd->ts_work = cpu_clock(get_cpu()); + put_cpu(); + } if (sd->func_descs_valid == 0) { if (sd->failed_inits < MAX_FAILED_INITS) { @@ -1029,7 +1031,8 @@ static void syn_isr_work(struct work_struct *work) out: if (sd->f_measure) { - sd->ts_done = cpu_clock(smp_processor_id()); + sd->ts_done = cpu_clock(get_cpu()); + put_cpu(); syn_recalculate_latency_data(sd); sd->f_measure = 0; } @@ -1046,7 +1049,8 @@ static irqreturn_t syn_isr(int irq, void *data) r = queue_work(sd->wq, &sd->isr_work); if (r) { if (sd->f_measure == 0) { - sd->ts_intr = cpu_clock(smp_processor_id()); + sd->ts_intr = cpu_clock(get_cpu()); + put_cpu(); sd->f_measure = 1; } disable_irq_nosync(gpio_to_irq(sd->gpio_intr)); |