aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@in.ibm.com>2006-03-17 02:04:06 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-17 10:51:25 -0500
commit82c3c03a4096badd026c6e337f3c5dde020e9ec6 (patch)
treed22aa75410eb3b2bc7865f6dc6ce6c111c103bc9 /arch
parent8532159f5521ba24e697f0d25970ae89ff62a1f2 (diff)
[PATCH] x86: check for online cpus before bringing them up
Bryce reported a bug wherein offlining CPU0 (on x86 box) and then subsequently onlining it resulted in a lockup. On x86, CPU0 is never offlined. The subsequent attempt to online CPU0 doesn't take that into account. It actually tries to bootup the already booted CPU. Following patch fixes the problem (as acknowledged by Bryce). Please consider for inclusion in 2.6.16. Check if cpu is already online. Signed-off-by: Srivatsa Vaddagiri <vatsa@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/smpboot.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index eba7f53f8b4a..7007e1783797 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -1029,6 +1029,16 @@ int __devinit smp_prepare_cpu(int cpu)
1029 int apicid, ret; 1029 int apicid, ret;
1030 1030
1031 lock_cpu_hotplug(); 1031 lock_cpu_hotplug();
1032
1033 /*
1034 * On x86, CPU0 is never offlined. Trying to bring up an
1035 * already-booted CPU will hang. So check for that case.
1036 */
1037 if (cpu_online(cpu)) {
1038 ret = -EINVAL;
1039 goto exit;
1040 }
1041
1032 apicid = x86_cpu_to_apicid[cpu]; 1042 apicid = x86_cpu_to_apicid[cpu];
1033 if (apicid == BAD_APICID) { 1043 if (apicid == BAD_APICID) {
1034 ret = -ENODEV; 1044 ret = -ENODEV;