powerpc: Linux cannot run with 0 cores
authorAnton Blanchard <anton@samba.org>
Thu, 17 Jun 2010 14:33:06 +0000 (14:33 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 8 Jul 2010 08:11:42 +0000 (18:11 +1000)
commit33ad5e4b6cab3ad8cf3afda49b66393f1833150e
tree446a0139ed39a6eb94baa8ccb0742ca5b670d65a
parent3880ecb05bc5ece4c6e392a21ea77518e55b4935
powerpc: Linux cannot run with 0 cores

If we configure with CONFIG_SMP=n or set NR_CPUS less than the number of
SMT threads we will set the max cores property to 0 in the
ibm,client-architecture-support structure. On new versions of firmware that
understand this property it obliges and terminates our partition.

Use DIV_ROUND_UP so we handle not only the CONFIG_SMP=n case but also the
case where NR_CPUS isn't a multiple of the number of SMT threads.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/prom_init.c