mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 11:44:01 +08:00
mips/octeon/smp: Convert to hotplug state machine
Install the callbacks via the state machine. [ tglx: Renamed the state to MIPS_SOC_PREPARE so it can be reused by other SOCs ] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: Peter Zijlstra <peterz@infradead.org> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160906170457.32393-16-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
8c58898b3e
commit
dd6d7c6f3d
@ -380,29 +380,11 @@ static int octeon_update_boot_vector(unsigned int cpu)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int octeon_cpu_callback(struct notifier_block *nfb,
|
|
||||||
unsigned long action, void *hcpu)
|
|
||||||
{
|
|
||||||
unsigned int cpu = (unsigned long)hcpu;
|
|
||||||
|
|
||||||
switch (action & ~CPU_TASKS_FROZEN) {
|
|
||||||
case CPU_UP_PREPARE:
|
|
||||||
octeon_update_boot_vector(cpu);
|
|
||||||
break;
|
|
||||||
case CPU_ONLINE:
|
|
||||||
pr_info("Cpu %d online\n", cpu);
|
|
||||||
break;
|
|
||||||
case CPU_DEAD:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NOTIFY_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int register_cavium_notifier(void)
|
static int register_cavium_notifier(void)
|
||||||
{
|
{
|
||||||
hotcpu_notifier(octeon_cpu_callback, 0);
|
return cpuhp_setup_state_nocalls(CPUHP_MIPS_SOC_PREPARE,
|
||||||
return 0;
|
"mips/cavium:prepare",
|
||||||
|
octeon_update_boot_vector, NULL);
|
||||||
}
|
}
|
||||||
late_initcall(register_cavium_notifier);
|
late_initcall(register_cavium_notifier);
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ enum cpuhp_state {
|
|||||||
CPUHP_SH_SH3X_PREPARE,
|
CPUHP_SH_SH3X_PREPARE,
|
||||||
CPUHP_TIMERS_DEAD,
|
CPUHP_TIMERS_DEAD,
|
||||||
CPUHP_NOTF_ERR_INJ_PREPARE,
|
CPUHP_NOTF_ERR_INJ_PREPARE,
|
||||||
|
CPUHP_MIPS_SOC_PREPARE,
|
||||||
CPUHP_BRINGUP_CPU,
|
CPUHP_BRINGUP_CPU,
|
||||||
CPUHP_AP_IDLE_DEAD,
|
CPUHP_AP_IDLE_DEAD,
|
||||||
CPUHP_AP_OFFLINE,
|
CPUHP_AP_OFFLINE,
|
||||||
|
Loading…
Reference in New Issue
Block a user