From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932441AbcISTyT (ORCPT ); Mon, 19 Sep 2016 15:54:19 -0400 Received: from terminus.zytor.com ([198.137.202.10]:36810 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932109AbcISTyR (ORCPT ); Mon, 19 Sep 2016 15:54:17 -0400 Date: Mon, 19 Sep 2016 12:53:46 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: hpa@zytor.com, peterz@infradead.org, bigeasy@linutronix.de, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, peterz@infradead.org, bigeasy@linutronix.de, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20160906170457.32393-6-bigeasy@linutronix.de> References: <20160906170457.32393-6-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] sh/SH-X3 SMP: Convert to hotplug state machine Git-Commit-ID: 515332336be71d014bca1d29369c5d72baa38f71 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: 515332336be71d014bca1d29369c5d72baa38f71 Gitweb: http://git.kernel.org/tip/515332336be71d014bca1d29369c5d72baa38f71 Author: Sebastian Andrzej Siewior AuthorDate: Tue, 6 Sep 2016 19:04:41 +0200 Committer: Thomas Gleixner CommitDate: Mon, 19 Sep 2016 21:44:27 +0200 sh/SH-X3 SMP: Convert to hotplug state machine Install the callbacks via the state machine. Signed-off-by: Sebastian Andrzej Siewior Cc: Peter Zijlstra Cc: linux-sh@vger.kernel.org Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160906170457.32393-6-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner --- arch/sh/kernel/cpu/sh4a/smp-shx3.c | 26 +++++--------------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c index 839612c..0d3637c 100644 --- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c @@ -122,32 +122,16 @@ static void shx3_update_boot_vector(unsigned int cpu) __raw_writel(STBCR_RESET, STBCR_REG(cpu)); } -static int -shx3_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) +static int shx3_cpu_prepare(unsigned int cpu) { - unsigned int cpu = (unsigned int)hcpu; - - switch (action) { - case CPU_UP_PREPARE: - shx3_update_boot_vector(cpu); - break; - case CPU_ONLINE: - pr_info("CPU %u is now online\n", cpu); - break; - case CPU_DEAD: - break; - } - - return NOTIFY_OK; + shx3_update_boot_vector(cpu); + return 0; } -static struct notifier_block shx3_cpu_notifier = { - .notifier_call = shx3_cpu_callback, -}; - static int register_shx3_cpu_notifier(void) { - register_hotcpu_notifier(&shx3_cpu_notifier); + cpuhp_setup_state_nocalls(CPUHP_SH_SH3X_PREPARE, "sh/shx3:prepare", + shx3_cpu_prepare, NULL); return 0; } late_initcall(register_shx3_cpu_notifier); diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 35859aa..8dec2a2 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -37,6 +37,7 @@ enum cpuhp_state { CPUHP_POWERPC_MMU_CTX_PREPARE, CPUHP_NOTIFY_PREPARE, CPUHP_ARM_SHMOBILE_SCU_PREPARE, + CPUHP_SH_SH3X_PREPARE, CPUHP_TIMERS_DEAD, CPUHP_BRINGUP_CPU, CPUHP_AP_IDLE_DEAD,