public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/watchdog.c : fix smp_processor_id() warning
@ 2012-07-25  4:39 Ming Lei
  2012-07-26 19:43 ` Don Zickus
  0 siblings, 1 reply; 4+ messages in thread
From: Ming Lei @ 2012-07-25  4:39 UTC (permalink / raw)
  To: Sameer Nanda, Andrew Morton, Ingo Molnar; +Cc: linux-kernel, Ming Lei

Use raw_smp_processor_id in lockup_detector_bootcpu_resume()
because it is enough when non-boot CPUs are offline.

This patch fixes the following warning when DEBUG_PREEMPT
is enabled.

[  168.259429] BUG: using smp_processor_id() in preemptible [00000000] code: pm/1577
[  168.259460] caller is lockup_detector_bootcpu_resume+0x8/0x48
[  168.259490] [<c001558c>] (unwind_backtrace+0x0/0x11c) from [<c0296874>] (debug_smp_processor_id+0xbc/0xf0)
[  168.259521] [<c0296874>] (debug_smp_processor_id+0xbc/0xf0) from [<c0090114>] (lockup_detector_bootcpu_res
ume+0x8/0x48)
[  168.259552] [<c0090114>] (lockup_detector_bootcpu_resume+0x8/0x48) from [<c006facc>] (suspend_devices_and_
enter+0x1f8/0x358)
[  168.259552] [<c006facc>] (suspend_devices_and_enter+0x1f8/0x358) from [<c006fd68>] (pm_suspend+0x13c/0x204
)
[  168.259582] [<c006fd68>] (pm_suspend+0x13c/0x204) from [<c006f0d0>] (state_store+0xb0/0xd4)
[  168.259582] [<c006f0d0>] (state_store+0xb0/0xd4) from [<c028a3d8>] (kobj_attr_store+0x14/0x20)
[  168.259613] [<c028a3d8>] (kobj_attr_store+0x14/0x20) from [<c014d344>] (sysfs_write_file+0x10c/0x140)
[  168.259643] [<c014d344>] (sysfs_write_file+0x10c/0x140) from [<c00f5a88>] (vfs_write+0xb0/0x138)
[  168.259643] [<c00f5a88>] (vfs_write+0xb0/0x138) from [<c00f5ce8>] (sys_write+0x3c/0x68)
[  168.259674] [<c00f5ce8>] (sys_write+0x3c/0x68) from [<c000e020>] (ret_fast_syscall+0x0/0x48)
[  168.260375] Enabling non-boot CPUs ...

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 kernel/watchdog.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 69add8a..7ddb11b 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -623,7 +623,7 @@ static struct notifier_block cpu_nfb = {
  */
 void lockup_detector_bootcpu_resume(void)
 {
-	void *cpu = (void *)(long)smp_processor_id();
+	void *cpu = (void *)(long)raw_smp_processor_id();
 
 	cpu_callback(&cpu_nfb, CPU_DEAD_FROZEN, cpu);
 	cpu_callback(&cpu_nfb, CPU_UP_PREPARE_FROZEN, cpu);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-27 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-25  4:39 [PATCH] kernel/watchdog.c : fix smp_processor_id() warning Ming Lei
2012-07-26 19:43 ` Don Zickus
2012-07-27  0:38   ` Ming Lei
2012-07-27 14:37     ` Don Zickus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox