diff options
author | Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com> | 2014-10-15 11:31:46 -0500 |
---|---|---|
committer | Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com> | 2014-10-15 11:31:46 -0500 |
commit | 798017f249bd9d8087c1d92038f529ea5ae511e6 (patch) | |
tree | 8b34de9cd041003cc3f63deaf03ea7216104be08 | |
parent | 46c56393666c08ab1dc06c4d8c3feaaec6092d1b (diff) |
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 <Ranjani.Vaidyanathan@freescale.com>
-rw-r--r-- | arch/arm/mach-mx6/platsmp.c | 7 |
1 files 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++) { |