]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc: Check cpu_thread_in_subcore() in __cpu_up()
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 23 May 2014 08:15:28 +0000 (18:15 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 28 May 2014 03:35:36 +0000 (13:35 +1000)
To support split core we need to change the check in __cpu_up() that
determines if a cpu is allowed to come online.

Currently we refuse to online cpus which are not the primary thread
within their core.

On POWER8 with split core support this check needs to instead refuse to
online cpus which are not the primary thread within their *sub* core.

On POWER7 and other systems that do not support split core,
threads_per_subcore == threads_per_core and so the check is equivalent.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/smp.c

index 5cdd9eb3b24c389d4b3b7067a480dce14878ccb0..6af946e9a9849ee6b3681326a9fadb5b6ca20821 100644 (file)
@@ -490,7 +490,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
         * Don't allow secondary threads to come online if inhibited
         */
        if (threads_per_core > 1 && secondaries_inhibited() &&
-           cpu % threads_per_core != 0)
+           cpu_thread_in_subcore(cpu))
                return -EBUSY;
 
        if (smp_ops == NULL ||