From 798017f249bd9d8087c1d92038f529ea5ae511e6 Mon Sep 17 00:00:00 2001 From: Ranjani Vaidyanathan Date: Wed, 15 Oct 2014 11:31:46 -0500 Subject: MLK-9685 ARM:imx6x:Ensure that the kernel can boot with "nosmp" in the command line When nosmp is added to the command line, setup_max_cpus is set to 0 by the kernel. And this results in num_possible_cpus() returning 0 and the kernel does not boot. This patch ensures that at least one CPU's state is set to "possible" as part of the boot process. Cherry picked from 3.10.y kernel: e94363b07a94bfe587a78330f7b9517f5cacb273 Signed-off-by: Ranjani Vaidyanathan --- arch/arm/mach-mx6/platsmp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-mx6/platsmp.c b/arch/arm/mach-mx6/platsmp.c index 4f861f9e96e2..f85164f6441b 100644 --- a/arch/arm/mach-mx6/platsmp.c +++ b/arch/arm/mach-mx6/platsmp.c @@ -125,10 +125,13 @@ void __init smp_init_cpus(void) if (setup_max_cpus >= ncores) setup_max_cpus = ncores; - for (i = 0; i < setup_max_cpus; i++) + if (setup_max_cpus < ncores) + ncores = (setup_max_cpus) ? setup_max_cpus : 1; + + for (i = 0; i < ncores; i++) set_cpu_possible(i, true); - for (i = setup_max_cpus; i < ncores; i++) + for (i = ncores; i < NR_CPUS; i++) set_cpu_possible(i, false); /* Set the SCU CPU Power status for each inactive core. */ for (i = 0; i < NR_CPUS; i++) { -- cgit v1.2.3