summaryrefslogtreecommitdiff
path: root/arch/arm/mach-msm/platsmp.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-10-21 01:04:18 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-10-21 01:06:57 +0400
commita06f916b7a9b57447ceb875eb0a89f1a66b31bca (patch)
treea8a9d7c5e91a08f253107ffcf066dbeb4f7d9d34 /arch/arm/mach-msm/platsmp.c
parent5a567d78c437e3be1c512734cdfe64b4ae6b82d7 (diff)
downloadlinux-a06f916b7a9b57447ceb875eb0a89f1a66b31bca.tar.xz
ARM: smp: fix clipping of number of CPUs
Rather than clipping the number of CPUs using the compile-time NR_CPUS constant, use the runtime nr_cpu_ids value instead. This allows the nr_cpus command line option to work as expected. Cc: <stable@kernel.org> Reported-by: Mark Salter <msalter@redhat.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-msm/platsmp.c')
-rw-r--r--arch/arm/mach-msm/platsmp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index 1a1af9e56250..727659520912 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -156,6 +156,12 @@ void __init smp_init_cpus(void)
{
unsigned int i, ncores = get_core_count();
+ if (ncores > nr_cpu_ids) {
+ pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
+ ncores, nr_cpu_ids);
+ ncores = nr_cpu_ids;
+ }
+
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);