[ARM] Solve buggy smp_processor_id() usage
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sat, 2 Jun 2007 14:36:37 +0000 (15:36 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 2 Jun 2007 20:31:49 +0000 (21:31 +0100)
BUG: using smp_processor_id() in preemptible [00000001] code: opcontrol/427

Resolve this bug by ensuring that we're not using smp_processor_id() in
a preemptable context (by disabling preemption.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/oprofile/op_model_mpcore.c

index 7791da791f5f936cb54c7d1f7cf38832652007e5..75bae067922d1c55fdef728f67e8f952062009be 100644 (file)
@@ -200,8 +200,10 @@ static int em_call_function(int (*fn)(void))
        data.fn = fn;
        data.ret = 0;
 
+       preempt_disable();
        smp_call_function(em_func, &data, 1, 1);
        em_func(&data);
+       preempt_enable();
 
        return data.ret;
 }