From: Heiko Carstens Date: Mon, 30 Mar 2015 10:51:42 +0000 (+0200) Subject: s390/smp: wait until secondaries are active & online X-Git-Tag: v4.1-rc1~130^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a1307bba1adcc9b338511180fa94a54b4c3f534b;p=karo-tx-linux.git 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 Signed-off-by: Martin Schwidefsky --- 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; }