Skip to content

Commit

Permalink
[S390] cpu hotplug: on cpu start wait until being marked active
Browse files Browse the repository at this point in the history
This is the same as fd8a7de "x86: cpu-hotplug: Prevent softirq wakeup
on wrong CPU".
Unlike on x86 this doesn't fix a bug on s390 since we do not have
threaded interrupt handlers. However we want to keep the same
initialization order like on x86. This should prevent bugs caused by
code which assumes (and relies on) the init order is the same on each
architecture.

Signed-off-by: Heiko Carstens <[email protected]>
  • Loading branch information
heicarst committed Aug 3, 2011
1 parent 391c62f commit cc34321
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,12 @@ int __cpuinit start_secondary(void *cpuvoid)
S390_lowcore.restart_psw.addr =
PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler;
__ctl_set_bit(0, 28); /* Enable lowcore protection */
/* Switch on interrupts */
/*
* Wait until the cpu which brought this one up marked it
* active before enabling interrupts.
*/
while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask))
cpu_relax();
local_irq_enable();
/* cpu_idle will call schedule for us */
cpu_idle();
Expand Down

0 comments on commit cc34321

Please sign in to comment.