summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/cell/smp.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-10-25 09:27:44 +0400
committerPaul Mackerras <paulus@samba.org>2007-12-03 05:56:25 +0300
commit8d089085a4e6d8a91c954130cb4caebd50788a08 (patch)
tree8f852ded25d15ae8cd84c8260909db787292e260 /arch/powerpc/platforms/cell/smp.c
parentb80fa3cce7390185e43ea22e9b3c38ab138bc580 (diff)
downloadlinux-8d089085a4e6d8a91c954130cb4caebd50788a08.tar.xz
[POWERPC] Cleanup SMT thread handling
This cleans up the SMT thread handling, removing some hard coded assumptions and providing a set of helpers to convert between linux cpu numbers, thread numbers and cores. This implementation requires the number of threads per core to be a power of 2 and identical on all cores in the system, but it's an implementation detail, not an API requirement and so this limitation can be lifted in the future if anybody ever needs it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/smp.c')
-rw-r--r--arch/powerpc/platforms/cell/smp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index e4438456c867..efb3964457b1 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -42,6 +42,7 @@
#include <asm/firmware.h>
#include <asm/system.h>
#include <asm/rtas.h>
+#include <asm/cputhreads.h>
#include "interrupt.h"
#include <asm/udbg.h>
@@ -182,7 +183,7 @@ static int smp_cell_cpu_bootable(unsigned int nr)
*/
if (system_state < SYSTEM_RUNNING &&
cpu_has_feature(CPU_FTR_SMT) &&
- !smt_enabled_at_boot && nr % 2 != 0)
+ !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
return 0;
return 1;