]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mpic: Add support for discontiguous cores
authorTimur Tabi <timur@freescale.com>
Fri, 8 Jul 2011 11:12:42 +0000 (11:12 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 19 Sep 2011 23:19:42 +0000 (09:19 +1000)
commitf1352e2022de02893d553323a18b0c2133b59daf
tree505302eb318e3e03863ddeb528dca5f923bce002
parent8b4937a111c0506088cde8be13a81144b468e76e
powerpc/mpic: Add support for discontiguous cores

There is one place in the MPIC driver that assumes that the cores are numbered
from 0 to n-1.  However, this is not true if the CPUs are not numbered
sequentially.  This can happen on a eight-core SOC where cores two and three
are removed in the device tree.  So instead of blindly looping, we iterate
over the discovered CPUs and use the SMP ID as the index.

This means that we no longer ask the MPIC how many CPUs there are, so
we also delete mpic->num_cpus.

We also catch if the number of CPUs in the SOC exceeds the number that the
MPIC supports.  This should never happen, of course, but it's good to be
sure.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/mpic.h
arch/powerpc/sysdev/mpic.c