summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2015-03-30 12:51:42 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-04-13 10:46:20 +0200
commita1307bba1adcc9b338511180fa94a54b4c3f534b (patch)
tree0981b3630258d145af09a296d1b619a2b39a13f2 /arch/s390
parentd74419495633493c9cd3f2bbeb7f3529d0edded6 (diff)
downloadblackbird-op-linux-a1307bba1adcc9b338511180fa94a54b4c3f534b.tar.gz
blackbird-op-linux-a1307bba1adcc9b338511180fa94a54b4c3f534b.zip
s390/smp: wait until secondaries are active & online
This is the s390 version of 875ebe940d77 ("powerpc/smp: Wait until secondaries are active & online"). The race described in length within the commit message is also possible on s390 and every other architecture. So fix this race on s390 as well. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/smp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index d140160c9aec..efd2c1968000 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -818,7 +818,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
pcpu_prepare_secondary(pcpu, cpu);
pcpu_attach_task(pcpu, tidle);
pcpu_start_fn(pcpu, smp_start_secondary, NULL);
- while (!cpu_online(cpu))
+ /* Wait until cpu puts itself in the online & active maps */
+ while (!cpu_online(cpu) || !cpu_active(cpu))
cpu_relax();
return 0;
}
OpenPOWER on IntegriCloud