Commit 148b9e2a authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Ingo Molnar

x86/apb_timer: Convert to hotplug state machine

Install the callbacks via the state machine. There is no setup just one
teardown callback. Remove the silly comment about the workqueue up dependency.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153335.625342983@linutronix.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 251a5fd6
...@@ -215,26 +215,18 @@ void apbt_setup_secondary_clock(void) ...@@ -215,26 +215,18 @@ void apbt_setup_secondary_clock(void)
* cpu timers during the offline process due to the ordering of notification. * cpu timers during the offline process due to the ordering of notification.
* the extra interrupt is harmless. * the extra interrupt is harmless.
*/ */
static int apbt_cpuhp_notify(struct notifier_block *n, static int apbt_cpu_dead(unsigned int cpu)
unsigned long action, void *hcpu)
{ {
unsigned long cpu = (unsigned long)hcpu;
struct apbt_dev *adev = &per_cpu(cpu_apbt_dev, cpu); struct apbt_dev *adev = &per_cpu(cpu_apbt_dev, cpu);
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_DEAD:
dw_apb_clockevent_pause(adev->timer); dw_apb_clockevent_pause(adev->timer);
if (system_state == SYSTEM_RUNNING) { if (system_state == SYSTEM_RUNNING) {
pr_debug("skipping APBT CPU %lu offline\n", cpu); pr_debug("skipping APBT CPU %u offline\n", cpu);
} else { } else {
pr_debug("APBT clockevent for cpu %lu offline\n", cpu); pr_debug("APBT clockevent for cpu %u offline\n", cpu);
dw_apb_clockevent_stop(adev->timer); dw_apb_clockevent_stop(adev->timer);
} }
break; return 0;
default:
pr_debug("APBT notified %lu, no action\n", action);
}
return NOTIFY_OK;
} }
static __init int apbt_late_init(void) static __init int apbt_late_init(void)
...@@ -242,9 +234,8 @@ static __init int apbt_late_init(void) ...@@ -242,9 +234,8 @@ static __init int apbt_late_init(void)
if (intel_mid_timer_options == INTEL_MID_TIMER_LAPIC_APBT || if (intel_mid_timer_options == INTEL_MID_TIMER_LAPIC_APBT ||
!apb_timer_block_enabled) !apb_timer_block_enabled)
return 0; return 0;
/* This notifier should be called after workqueue is ready */ return cpuhp_setup_state(CPUHP_X86_APB_DEAD, "X86_APB_DEAD", NULL,
hotcpu_notifier(apbt_cpuhp_notify, -20); apbt_cpu_dead);
return 0;
} }
fs_initcall(apbt_late_init); fs_initcall(apbt_late_init);
#else #else
......
...@@ -13,6 +13,7 @@ enum cpuhp_state { ...@@ -13,6 +13,7 @@ enum cpuhp_state {
CPUHP_PERF_POWER, CPUHP_PERF_POWER,
CPUHP_PERF_SUPERH, CPUHP_PERF_SUPERH,
CPUHP_X86_HPET_DEAD, CPUHP_X86_HPET_DEAD,
CPUHP_X86_APB_DEAD,
CPUHP_WORKQUEUE_PREP, CPUHP_WORKQUEUE_PREP,
CPUHP_NOTIFY_PREPARE, CPUHP_NOTIFY_PREPARE,
CPUHP_BRINGUP_CPU, CPUHP_BRINGUP_CPU,
......
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