diff options
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 4d2128ac70bd..668d8f2a8781 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1303,10 +1303,14 @@ static void __ref remove_cpu_from_maps(int cpu) | |||
1303 | numa_remove_cpu(cpu); | 1303 | numa_remove_cpu(cpu); |
1304 | } | 1304 | } |
1305 | 1305 | ||
1306 | static DEFINE_PER_CPU(struct completion, die_complete); | ||
1307 | |||
1306 | void cpu_disable_common(void) | 1308 | void cpu_disable_common(void) |
1307 | { | 1309 | { |
1308 | int cpu = smp_processor_id(); | 1310 | int cpu = smp_processor_id(); |
1309 | 1311 | ||
1312 | init_completion(&per_cpu(die_complete, smp_processor_id())); | ||
1313 | |||
1310 | remove_siblinginfo(cpu); | 1314 | remove_siblinginfo(cpu); |
1311 | 1315 | ||
1312 | /* It's now safe to remove this processor from the online map */ | 1316 | /* It's now safe to remove this processor from the online map */ |
@@ -1316,8 +1320,6 @@ void cpu_disable_common(void) | |||
1316 | fixup_irqs(); | 1320 | fixup_irqs(); |
1317 | } | 1321 | } |
1318 | 1322 | ||
1319 | static DEFINE_PER_CPU(struct completion, die_complete); | ||
1320 | |||
1321 | int native_cpu_disable(void) | 1323 | int native_cpu_disable(void) |
1322 | { | 1324 | { |
1323 | int ret; | 1325 | int ret; |
@@ -1327,16 +1329,21 @@ int native_cpu_disable(void) | |||
1327 | return ret; | 1329 | return ret; |
1328 | 1330 | ||
1329 | clear_local_APIC(); | 1331 | clear_local_APIC(); |
1330 | init_completion(&per_cpu(die_complete, smp_processor_id())); | ||
1331 | cpu_disable_common(); | 1332 | cpu_disable_common(); |
1332 | 1333 | ||
1333 | return 0; | 1334 | return 0; |
1334 | } | 1335 | } |
1335 | 1336 | ||
1337 | void cpu_die_common(unsigned int cpu) | ||
1338 | { | ||
1339 | wait_for_completion_timeout(&per_cpu(die_complete, cpu), HZ); | ||
1340 | } | ||
1341 | |||
1336 | void native_cpu_die(unsigned int cpu) | 1342 | void native_cpu_die(unsigned int cpu) |
1337 | { | 1343 | { |
1338 | /* We don't do anything here: idle task is faking death itself. */ | 1344 | /* We don't do anything here: idle task is faking death itself. */ |
1339 | wait_for_completion_timeout(&per_cpu(die_complete, cpu), HZ); | 1345 | |
1346 | cpu_die_common(cpu); | ||
1340 | 1347 | ||
1341 | /* They ack this in play_dead() by setting CPU_DEAD */ | 1348 | /* They ack this in play_dead() by setting CPU_DEAD */ |
1342 | if (per_cpu(cpu_state, cpu) == CPU_DEAD) { | 1349 | if (per_cpu(cpu_state, cpu) == CPU_DEAD) { |