diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2014-06-27 17:59:52 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-08-01 18:06:42 -0400 |
commit | eac44d9c956b3c5a6b5aaf666d5ae6226a1cc1d2 (patch) | |
tree | 711c567250561c600ca2ed9bc54018b49afa0b5c /arch/mips/cavium-octeon | |
parent | 5ca0e377a649149d717569bfd53e236d474e1331 (diff) |
MIPS: OCTEON: disable HOTPLUG_CPU if the bootloader version is incorrect
Disable HOTPLUG_CPU functionality if the bootloader version is incorrect.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-mips@linux-mips.org
Cc: David Daney <ddaney.cavm@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/7200/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cavium-octeon')
-rw-r--r-- | arch/mips/cavium-octeon/smp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c index ea969309b35f..ecd903dd1c45 100644 --- a/arch/mips/cavium-octeon/smp.c +++ b/arch/mips/cavium-octeon/smp.c | |||
@@ -88,8 +88,10 @@ static void octeon_smp_hotplug_setup(void) | |||
88 | return; | 88 | return; |
89 | 89 | ||
90 | labi = (struct linux_app_boot_info *)PHYS_TO_XKSEG_CACHED(LABI_ADDR_IN_BOOTLOADER); | 90 | labi = (struct linux_app_boot_info *)PHYS_TO_XKSEG_CACHED(LABI_ADDR_IN_BOOTLOADER); |
91 | if (labi->labi_signature != LABI_SIGNATURE) | 91 | if (labi->labi_signature != LABI_SIGNATURE) { |
92 | panic("The bootloader version on this board is incorrect."); | 92 | pr_info("The bootloader on this board does not support HOTPLUG_CPU."); |
93 | return; | ||
94 | } | ||
93 | 95 | ||
94 | octeon_bootloader_entry_addr = labi->InitTLBStart_addr; | 96 | octeon_bootloader_entry_addr = labi->InitTLBStart_addr; |
95 | #endif | 97 | #endif |
@@ -132,7 +134,8 @@ static void octeon_smp_setup(void) | |||
132 | * will assign CPU numbers for possible cores as well. Cores | 134 | * will assign CPU numbers for possible cores as well. Cores |
133 | * are always consecutively numberd from 0. | 135 | * are always consecutively numberd from 0. |
134 | */ | 136 | */ |
135 | for (id = 0; setup_max_cpus && id < num_cores && id < NR_CPUS; id++) { | 137 | for (id = 0; setup_max_cpus && octeon_bootloader_entry_addr && |
138 | id < num_cores && id < NR_CPUS; id++) { | ||
136 | if (!(core_mask & (1 << id))) { | 139 | if (!(core_mask & (1 << id))) { |
137 | set_cpu_possible(cpus, true); | 140 | set_cpu_possible(cpus, true); |
138 | __cpu_number_map[id] = cpus; | 141 | __cpu_number_map[id] = cpus; |
@@ -232,6 +235,9 @@ static int octeon_cpu_disable(void) | |||
232 | if (cpu == 0) | 235 | if (cpu == 0) |
233 | return -EBUSY; | 236 | return -EBUSY; |
234 | 237 | ||
238 | if (!octeon_bootloader_entry_addr) | ||
239 | return -ENOTSUPP; | ||
240 | |||
235 | set_cpu_online(cpu, false); | 241 | set_cpu_online(cpu, false); |
236 | cpu_clear(cpu, cpu_callin_map); | 242 | cpu_clear(cpu, cpu_callin_map); |
237 | local_irq_disable(); | 243 | local_irq_disable(); |