From 22325525d8bb1478daddefec1b762e7882bcd515 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Fri, 8 Jan 2010 16:59:34 +0100 Subject: [PATCH] ARM: 5868/1: ARM: fix "BUG: using smp_processor_id() in preemptible code" Fix the following warning, which appears when the register dump for a faulting process is printed in a kernel with SMP, DEBUG_PREEMPT, and DEBUG_USER (with user_debug=31) enabled: BUG: using smp_processor_id() in preemptible [00000000] code: init/1 caller is __show_regs+0x18/0x234 Backtrace: [] (dump_backtrace+0x0/0x114) from [] (dump_stack+0x18/0x1c) r6:c781a000 r5:c0157544 r4:00000001 r3:00000000 [] (dump_stack+0x0/0x1c) from [] (debug_smp_processor_id+0xc4/0xf8) [] (debug_smp_processor_id+0x0/0xf8) from [] (__show_regs+0x18/0x234) r6:c781bfb0 r5:00000000 r4:c781bfb0 r3:00000000 [] (__show_regs+0x0/0x234) from [] (show_regs+0x40/0x50) [] (show_regs+0x0/0x50) from [] (__do_user_fault+0x5c/0xa4) r4:c781c000 r3:00000000 [] (__do_user_fault+0x0/0xa4) from [] (do_page_fault+0x1b4/0x1e4) r7:00000000 r6:00010000 r5:c781bfb0 r4:c781c000 [] (do_page_fault+0x0/0x1e4) from [] (do_DataAbort+0x3c/0xa0) [] (do_DataAbort+0x0/0xa0) from [] (ret_from_exception+0x0/0x10) Signed-off-by: Rabin Vincent Signed-off-by: Russell King --- arch/arm/kernel/process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 6730413..ba2adef 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -212,7 +212,8 @@ void __show_regs(struct pt_regs *regs) char buf[64]; printk("CPU: %d %s (%s %.*s)\n", - smp_processor_id(), print_tainted(), init_utsname()->release, + raw_smp_processor_id(), print_tainted(), + init_utsname()->release, (int)strcspn(init_utsname()->version, " "), init_utsname()->version); print_symbol("PC is at %s\n", instruction_pointer(regs)); -- 2.7.4