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
This commit is contained in:
committed by
Paul Burton
parent
9707b7e639
commit
2c86562047
@@ -29,6 +29,7 @@ struct plat_smp_ops {
|
|||||||
int (*boot_secondary)(int cpu, struct task_struct *idle);
|
int (*boot_secondary)(int cpu, struct task_struct *idle);
|
||||||
void (*smp_setup)(void);
|
void (*smp_setup)(void);
|
||||||
void (*prepare_cpus)(unsigned int max_cpus);
|
void (*prepare_cpus)(unsigned int max_cpus);
|
||||||
|
void (*prepare_boot_cpu)(void);
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
int (*cpu_disable)(void);
|
int (*cpu_disable)(void);
|
||||||
void (*cpu_die)(unsigned int cpu);
|
void (*cpu_die)(unsigned int cpu);
|
||||||
|
|||||||
@@ -444,6 +444,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
|||||||
/* preload SMP state for boot cpu */
|
/* preload SMP state for boot cpu */
|
||||||
void smp_prepare_boot_cpu(void)
|
void smp_prepare_boot_cpu(void)
|
||||||
{
|
{
|
||||||
|
if (mp_ops->prepare_boot_cpu)
|
||||||
|
mp_ops->prepare_boot_cpu();
|
||||||
set_cpu_possible(0, true);
|
set_cpu_possible(0, true);
|
||||||
set_cpu_online(0, true);
|
set_cpu_online(0, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,6 @@ void __init plat_mem_setup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ioc3_eth_init();
|
ioc3_eth_init();
|
||||||
per_cpu_init();
|
|
||||||
|
|
||||||
set_io_port_base(IO_BASE);
|
set_io_port_base(IO_BASE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action)
|
|||||||
ip27_send_ipi_single(i, action);
|
ip27_send_ipi_single(i, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ip27_init_secondary(void)
|
static void ip27_init_cpu(void)
|
||||||
{
|
{
|
||||||
per_cpu_init();
|
per_cpu_init();
|
||||||
}
|
}
|
||||||
@@ -235,9 +235,10 @@ static void __init ip27_prepare_cpus(unsigned int max_cpus)
|
|||||||
const struct plat_smp_ops ip27_smp_ops = {
|
const struct plat_smp_ops ip27_smp_ops = {
|
||||||
.send_ipi_single = ip27_send_ipi_single,
|
.send_ipi_single = ip27_send_ipi_single,
|
||||||
.send_ipi_mask = ip27_send_ipi_mask,
|
.send_ipi_mask = ip27_send_ipi_mask,
|
||||||
.init_secondary = ip27_init_secondary,
|
.init_secondary = ip27_init_cpu,
|
||||||
.smp_finish = ip27_smp_finish,
|
.smp_finish = ip27_smp_finish,
|
||||||
.boot_secondary = ip27_boot_secondary,
|
.boot_secondary = ip27_boot_secondary,
|
||||||
.smp_setup = ip27_smp_setup,
|
.smp_setup = ip27_smp_setup,
|
||||||
.prepare_cpus = ip27_prepare_cpus,
|
.prepare_cpus = ip27_prepare_cpus,
|
||||||
|
.prepare_boot_cpu = ip27_init_cpu,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user