From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbcGSHP0 (ORCPT ); Tue, 19 Jul 2016 03:15:26 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45666 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752604AbcGSHPY (ORCPT ); Tue, 19 Jul 2016 03:15:24 -0400 Date: Tue, 19 Jul 2016 00:14:54 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: peterz@infradead.org, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, bigeasy@linutronix.de, anna-maria@linutronix.de, tglx@linutronix.de, mingo@kernel.org Reply-To: peterz@infradead.org, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, bigeasy@linutronix.de, mingo@kernel.org, anna-maria@linutronix.de, tglx@linutronix.de In-Reply-To: <20160713153335.625342983@linutronix.de> References: <20160713153335.625342983@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] x86/apb_timer: Convert to hotplug state machine Git-Commit-ID: 148b9e2abea6f50e4620e4ac0683b4913c4364c0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 148b9e2abea6f50e4620e4ac0683b4913c4364c0 Gitweb: http://git.kernel.org/tip/148b9e2abea6f50e4620e4ac0683b4913c4364c0 Author: Sebastian Andrzej Siewior AuthorDate: Wed, 13 Jul 2016 17:16:34 +0000 Committer: Ingo Molnar CommitDate: Fri, 15 Jul 2016 10:40:22 +0200 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: Sebastian Andrzej Siewior Signed-off-by: Anna-Maria Gleixner Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153335.625342983@linutronix.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/apb_timer.c | 29 ++++++++++------------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c index cefacba..456316f 100644 --- a/arch/x86/kernel/apb_timer.c +++ b/arch/x86/kernel/apb_timer.c @@ -215,26 +215,18 @@ void apbt_setup_secondary_clock(void) * cpu timers during the offline process due to the ordering of notification. * the extra interrupt is harmless. */ -static int apbt_cpuhp_notify(struct notifier_block *n, - unsigned long action, void *hcpu) +static int apbt_cpu_dead(unsigned int cpu) { - unsigned long cpu = (unsigned long)hcpu; struct apbt_dev *adev = &per_cpu(cpu_apbt_dev, cpu); - switch (action & ~CPU_TASKS_FROZEN) { - case CPU_DEAD: - dw_apb_clockevent_pause(adev->timer); - if (system_state == SYSTEM_RUNNING) { - pr_debug("skipping APBT CPU %lu offline\n", cpu); - } else { - pr_debug("APBT clockevent for cpu %lu offline\n", cpu); - dw_apb_clockevent_stop(adev->timer); - } - break; - default: - pr_debug("APBT notified %lu, no action\n", action); + dw_apb_clockevent_pause(adev->timer); + if (system_state == SYSTEM_RUNNING) { + pr_debug("skipping APBT CPU %u offline\n", cpu); + } else { + pr_debug("APBT clockevent for cpu %u offline\n", cpu); + dw_apb_clockevent_stop(adev->timer); } - return NOTIFY_OK; + return 0; } 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 || !apb_timer_block_enabled) return 0; - /* This notifier should be called after workqueue is ready */ - hotcpu_notifier(apbt_cpuhp_notify, -20); - return 0; + return cpuhp_setup_state(CPUHP_X86_APB_DEAD, "X86_APB_DEAD", NULL, + apbt_cpu_dead); } fs_initcall(apbt_late_init); #else diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 8c190a8..3e719ba 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -13,6 +13,7 @@ enum cpuhp_state { CPUHP_PERF_POWER, CPUHP_PERF_SUPERH, CPUHP_X86_HPET_DEAD, + CPUHP_X86_APB_DEAD, CPUHP_WORKQUEUE_PREP, CPUHP_NOTIFY_PREPARE, CPUHP_BRINGUP_CPU,