Skip to content

Commit

Permalink
arm64/FP/SIMD: Convert to hotplug state machine
Browse files Browse the repository at this point in the history
Install the callbacks via the state machine.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Will 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.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Sebastian Andrzej Siewior authored and Thomas Gleixner committed Sep 19, 2016
1 parent da3ed65 commit c23a726
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
22 changes: 5 additions & 17 deletions arch/arm64/kernel/fpsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,28 +299,16 @@ static inline void fpsimd_pm_init(void) { }
#endif /* CONFIG_CPU_PM */

#ifdef CONFIG_HOTPLUG_CPU
static int fpsimd_cpu_hotplug_notifier(struct notifier_block *nfb,
unsigned long action,
void *hcpu)
static int fpsimd_cpu_dead(unsigned int cpu)
{
unsigned int cpu = (long)hcpu;

switch (action) {
case CPU_DEAD:
case CPU_DEAD_FROZEN:
per_cpu(fpsimd_last_state, cpu) = NULL;
break;
}
return NOTIFY_OK;
per_cpu(fpsimd_last_state, cpu) = NULL;
return 0;
}

static struct notifier_block fpsimd_cpu_hotplug_notifier_block = {
.notifier_call = fpsimd_cpu_hotplug_notifier,
};

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
Expand Down
1 change: 1 addition & 0 deletions include/linux/cpuhotplug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum cpuhp_state {
CPUHP_SOFTIRQ_DEAD,
CPUHP_NET_MVNETA_DEAD,
CPUHP_CPUIDLE_DEAD,
CPUHP_ARM64_FPSIMD_DEAD,
CPUHP_WORKQUEUE_PREP,
CPUHP_POWER_NUMA_PREPARE,
CPUHP_HRTIMERS_PREPARE,
Expand Down

0 comments on commit c23a726

Please sign in to comment.