aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/smpboot.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-03-07 12:12:31 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-07 13:07:24 -0500
commitd04f41e35343f1d788551fd3f753f51794f4afcf (patch)
tree50f22b1deab312476254868e8ec8c0c592c3d3e0 /arch/i386/kernel/smpboot.c
parent08e15e81a40e3241ce93b4a43886f3abda184aa6 (diff)
[PATCH] CPU hotplug: call check_tsc_sync_source() with irqs off
check_tsc_sync_source() depends on being called with irqs disabled (it checks whether the TSC is coherent across two specific CPUs). This is incidentally true during bootup, but not during cpu hotplug __cpu_up(). This got found via smp_processor_id() debugging. disable irqs explicitly and remove the unconditional enabling of interrupts. Add touch_nmi_watchdog() to the cpu_online_map busy loop. this bug is present both on i386 and on x86_64. Reported-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386/kernel/smpboot.c')
-rw-r--r--arch/i386/kernel/smpboot.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 9b0dd2744c82..4ff55e675576 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -45,6 +45,7 @@
45#include <linux/notifier.h> 45#include <linux/notifier.h>
46#include <linux/cpu.h> 46#include <linux/cpu.h>
47#include <linux/percpu.h> 47#include <linux/percpu.h>
48#include <linux/nmi.h>
48 49
49#include <linux/delay.h> 50#include <linux/delay.h>
50#include <linux/mc146818rtc.h> 51#include <linux/mc146818rtc.h>
@@ -1278,8 +1279,9 @@ void __cpu_die(unsigned int cpu)
1278 1279
1279int __cpuinit __cpu_up(unsigned int cpu) 1280int __cpuinit __cpu_up(unsigned int cpu)
1280{ 1281{
1282 unsigned long flags;
1281#ifdef CONFIG_HOTPLUG_CPU 1283#ifdef CONFIG_HOTPLUG_CPU
1282 int ret=0; 1284 int ret = 0;
1283 1285
1284 /* 1286 /*
1285 * We do warm boot only on cpus that had booted earlier 1287 * We do warm boot only on cpus that had booted earlier
@@ -1297,23 +1299,25 @@ int __cpuinit __cpu_up(unsigned int cpu)
1297 /* In case one didn't come up */ 1299 /* In case one didn't come up */
1298 if (!cpu_isset(cpu, cpu_callin_map)) { 1300 if (!cpu_isset(cpu, cpu_callin_map)) {
1299 printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu); 1301 printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu);
1300 local_irq_enable();
1301 return -EIO; 1302 return -EIO;
1302 } 1303 }
1303 1304
1304 local_irq_enable();
1305
1306 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; 1305 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
1307 /* Unleash the CPU! */ 1306 /* Unleash the CPU! */
1308 cpu_set(cpu, smp_commenced_mask); 1307 cpu_set(cpu, smp_commenced_mask);
1309 1308
1310 /* 1309 /*
1311 * Check TSC synchronization with the AP: 1310 * Check TSC synchronization with the AP (keep irqs disabled
1311 * while doing so):
1312 */ 1312 */
1313 local_irq_save(flags);
1313 check_tsc_sync_source(cpu); 1314 check_tsc_sync_source(cpu);
1315 local_irq_restore(flags);
1314 1316
1315 while (!cpu_isset(cpu, cpu_online_map)) 1317 while (!cpu_isset(cpu, cpu_online_map)) {
1316 cpu_relax(); 1318 cpu_relax();
1319 touch_nmi_watchdog();
1320 }
1317 1321
1318#ifdef CONFIG_X86_GENERICARCH 1322#ifdef CONFIG_X86_GENERICARCH
1319 if (num_online_cpus() > 8 && genapic == &apic_default) 1323 if (num_online_cpus() > 8 && genapic == &apic_default)