linux-mips
[Top] [All Lists]

[PATCH v2 3/4] MIPS: OCTEON: support disabling HOTPLUG_CPU run-time

To: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>, David Daney <ddaney.cavm@gmail.com>
Subject: [PATCH v2 3/4] MIPS: OCTEON: support disabling HOTPLUG_CPU run-time
From: Aaro Koskinen <aaro.koskinen@iki.fi>
Date: Sat, 28 Jun 2014 00:59:51 +0300
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
In-reply-to: <1403906392-10650-1-git-send-email-aaro.koskinen@iki.fi>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1403906392-10650-1-git-send-email-aaro.koskinen@iki.fi>
Sender: linux-mips-bounce@linux-mips.org
If nosmp kernel option given, we can assume HOTPLUG_CPU is disabled.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: David Daney <david.daney@cavium.com>
---
 arch/mips/cavium-octeon/smp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 2c8d156..ea96930 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -84,6 +84,9 @@ static void octeon_smp_hotplug_setup(void)
 #ifdef CONFIG_HOTPLUG_CPU
        struct linux_app_boot_info *labi;
 
+       if (!setup_max_cpus)
+               return;
+
        labi = (struct linux_app_boot_info 
*)PHYS_TO_XKSEG_CACHED(LABI_ADDR_IN_BOOTLOADER);
        if (labi->labi_signature != LABI_SIGNATURE)
                panic("The bootloader version on this board is incorrect.");
@@ -129,7 +132,7 @@ static void octeon_smp_setup(void)
         * will assign CPU numbers for possible cores as well.  Cores
         * are always consecutively numberd from 0.
         */
-       for (id = 0; id < num_cores && id < NR_CPUS; id++) {
+       for (id = 0; setup_max_cpus && id < num_cores && id < NR_CPUS; id++) {
                if (!(core_mask & (1 << id))) {
                        set_cpu_possible(cpus, true);
                        __cpu_number_map[id] = cpus;
-- 
2.0.0


<Prev in Thread] Current Thread [Next in Thread>