Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1307bba authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

s390/smp: wait until secondaries are active & online



This is the s390 version of 875ebe94 ("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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent d7441949
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}