diff options
author | Thomas Bogendoerfer <tbogendoerfer@suse.de> | 2019-02-19 10:57:19 -0500 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-02-19 15:46:03 -0500 |
commit | 2c8656204742a5e2d373972b139d0cc26ae93ff0 (patch) | |
tree | 19c012111497259131f9dfe646617ceb6a0cb006 | |
parent | 9707b7e6394216f5c56c30a56c38bffec4c0474d (diff) |
MIPS: SGI-IP27: do boot CPU init later
To make use of per_cpu variables in interrupt code per_cpu_init() must
be done after setup_per_cpu_areas(). This is achieved by calling it
in smp_prepare_boot_cpu() via a new smp_ops method.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
-rw-r--r-- | arch/mips/include/asm/smp-ops.h | 1 | ||||
-rw-r--r-- | arch/mips/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/mips/sgi-ip27/ip27-init.c | 1 | ||||
-rw-r--r-- | arch/mips/sgi-ip27/ip27-smp.c | 5 |
4 files changed, 6 insertions, 3 deletions
diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h index b7123f9c0785..65618ff1280c 100644 --- a/arch/mips/include/asm/smp-ops.h +++ b/arch/mips/include/asm/smp-ops.h | |||
@@ -29,6 +29,7 @@ struct plat_smp_ops { | |||
29 | int (*boot_secondary)(int cpu, struct task_struct *idle); | 29 | int (*boot_secondary)(int cpu, struct task_struct *idle); |
30 | void (*smp_setup)(void); | 30 | void (*smp_setup)(void); |
31 | void (*prepare_cpus)(unsigned int max_cpus); | 31 | void (*prepare_cpus)(unsigned int max_cpus); |
32 | void (*prepare_boot_cpu)(void); | ||
32 | #ifdef CONFIG_HOTPLUG_CPU | 33 | #ifdef CONFIG_HOTPLUG_CPU |
33 | int (*cpu_disable)(void); | 34 | int (*cpu_disable)(void); |
34 | void (*cpu_die)(unsigned int cpu); | 35 | void (*cpu_die)(unsigned int cpu); |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 6fd9e94fc87e..bc4bb3c6bd00 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -444,6 +444,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
444 | /* preload SMP state for boot cpu */ | 444 | /* preload SMP state for boot cpu */ |
445 | void smp_prepare_boot_cpu(void) | 445 | void smp_prepare_boot_cpu(void) |
446 | { | 446 | { |
447 | if (mp_ops->prepare_boot_cpu) | ||
448 | mp_ops->prepare_boot_cpu(); | ||
447 | set_cpu_possible(0, true); | 449 | set_cpu_possible(0, true); |
448 | set_cpu_online(0, true); | 450 | set_cpu_online(0, true); |
449 | } | 451 | } |
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c index aba985cf07c0..e6fa9d0c708a 100644 --- a/arch/mips/sgi-ip27/ip27-init.c +++ b/arch/mips/sgi-ip27/ip27-init.c | |||
@@ -212,7 +212,6 @@ void __init plat_mem_setup(void) | |||
212 | #endif | 212 | #endif |
213 | 213 | ||
214 | ioc3_eth_init(); | 214 | ioc3_eth_init(); |
215 | per_cpu_init(); | ||
216 | 215 | ||
217 | set_io_port_base(IO_BASE); | 216 | set_io_port_base(IO_BASE); |
218 | } | 217 | } |
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index 545446dfe7fa..20b81209c6b8 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c | |||
@@ -177,7 +177,7 @@ static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action) | |||
177 | ip27_send_ipi_single(i, action); | 177 | ip27_send_ipi_single(i, action); |
178 | } | 178 | } |
179 | 179 | ||
180 | static void ip27_init_secondary(void) | 180 | static void ip27_init_cpu(void) |
181 | { | 181 | { |
182 | per_cpu_init(); | 182 | per_cpu_init(); |
183 | } | 183 | } |
@@ -235,9 +235,10 @@ static void __init ip27_prepare_cpus(unsigned int max_cpus) | |||
235 | const struct plat_smp_ops ip27_smp_ops = { | 235 | const struct plat_smp_ops ip27_smp_ops = { |
236 | .send_ipi_single = ip27_send_ipi_single, | 236 | .send_ipi_single = ip27_send_ipi_single, |
237 | .send_ipi_mask = ip27_send_ipi_mask, | 237 | .send_ipi_mask = ip27_send_ipi_mask, |
238 | .init_secondary = ip27_init_secondary, | 238 | .init_secondary = ip27_init_cpu, |
239 | .smp_finish = ip27_smp_finish, | 239 | .smp_finish = ip27_smp_finish, |
240 | .boot_secondary = ip27_boot_secondary, | 240 | .boot_secondary = ip27_boot_secondary, |
241 | .smp_setup = ip27_smp_setup, | 241 | .smp_setup = ip27_smp_setup, |
242 | .prepare_cpus = ip27_prepare_cpus, | 242 | .prepare_cpus = ip27_prepare_cpus, |
243 | .prepare_boot_cpu = ip27_init_cpu, | ||
243 | }; | 244 | }; |