Commit c23a7266 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Thomas Gleixner

arm64/FP/SIMD: Convert to hotplug state machine

Install the callbacks via the state machine.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: rt@linutronix.de
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20160906170457.32393-2-bigeasy@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent da3ed651
...@@ -299,28 +299,16 @@ static inline void fpsimd_pm_init(void) { } ...@@ -299,28 +299,16 @@ static inline void fpsimd_pm_init(void) { }
#endif /* CONFIG_CPU_PM */ #endif /* CONFIG_CPU_PM */
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
static int fpsimd_cpu_hotplug_notifier(struct notifier_block *nfb, static int fpsimd_cpu_dead(unsigned int cpu)
unsigned long action,
void *hcpu)
{ {
unsigned int cpu = (long)hcpu; per_cpu(fpsimd_last_state, cpu) = NULL;
return 0;
switch (action) {
case CPU_DEAD:
case CPU_DEAD_FROZEN:
per_cpu(fpsimd_last_state, cpu) = NULL;
break;
}
return NOTIFY_OK;
} }
static struct notifier_block fpsimd_cpu_hotplug_notifier_block = {
.notifier_call = fpsimd_cpu_hotplug_notifier,
};
static inline void fpsimd_hotplug_init(void) static inline void fpsimd_hotplug_init(void)
{ {
register_cpu_notifier(&fpsimd_cpu_hotplug_notifier_block); cpuhp_setup_state_nocalls(CPUHP_ARM64_FPSIMD_DEAD, "arm64/fpsimd:dead",
NULL, fpsimd_cpu_dead);
} }
#else #else
......
...@@ -20,6 +20,7 @@ enum cpuhp_state { ...@@ -20,6 +20,7 @@ enum cpuhp_state {
CPUHP_SOFTIRQ_DEAD, CPUHP_SOFTIRQ_DEAD,
CPUHP_NET_MVNETA_DEAD, CPUHP_NET_MVNETA_DEAD,
CPUHP_CPUIDLE_DEAD, CPUHP_CPUIDLE_DEAD,
CPUHP_ARM64_FPSIMD_DEAD,
CPUHP_WORKQUEUE_PREP, CPUHP_WORKQUEUE_PREP,
CPUHP_POWER_NUMA_PREPARE, CPUHP_POWER_NUMA_PREPARE,
CPUHP_HRTIMERS_PREPARE, CPUHP_HRTIMERS_PREPARE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment