summaryrefslogtreecommitdiff
path: root/arch/mips/cavium-octeon/smp.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2014-06-28 01:59:52 +0400
committerRalf Baechle <ralf@linux-mips.org>2014-08-02 02:06:42 +0400
commiteac44d9c956b3c5a6b5aaf666d5ae6226a1cc1d2 (patch)
tree711c567250561c600ca2ed9bc54018b49afa0b5c /arch/mips/cavium-octeon/smp.c
parent5ca0e377a649149d717569bfd53e236d474e1331 (diff)
downloadlinux-eac44d9c956b3c5a6b5aaf666d5ae6226a1cc1d2.tar.xz
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/smp.c')
-rw-r--r--arch/mips/cavium-octeon/smp.c12
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)
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.");
+ if (labi->labi_signature != LABI_SIGNATURE) {
+ pr_info("The bootloader on this board does not support HOTPLUG_CPU.");
+ return;
+ }
octeon_bootloader_entry_addr = labi->InitTLBStart_addr;
#endif
@@ -132,7 +134,8 @@ 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; setup_max_cpus && id < num_cores && id < NR_CPUS; id++) {
+ for (id = 0; setup_max_cpus && octeon_bootloader_entry_addr &&
+ id < num_cores && id < NR_CPUS; id++) {
if (!(core_mask & (1 << id))) {
set_cpu_possible(cpus, true);
__cpu_number_map[id] = cpus;
@@ -232,6 +235,9 @@ static int octeon_cpu_disable(void)
if (cpu == 0)
return -EBUSY;
+ if (!octeon_bootloader_entry_addr)
+ return -ENOTSUPP;
+
set_cpu_online(cpu, false);
cpu_clear(cpu, cpu_callin_map);
local_irq_disable();