From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753332AbcGSHXv (ORCPT ); Tue, 19 Jul 2016 03:23:51 -0400 Received: from terminus.zytor.com ([198.137.202.10]:46098 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216AbcGSHXm (ORCPT ); Tue, 19 Jul 2016 03:23:42 -0400 Date: Tue, 19 Jul 2016 00:22:55 -0700 From: tip-bot for Richard Cochran Message-ID: Cc: mingo@kernel.org, rcochran@linutronix.de, linux@arm.linux.org.uk, bigeasy@linutronix.de, hpa@zytor.com, brad.mouring@ni.com, torvalds@linux-foundation.org, robh@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, tglx@linutronix.de, anna-maria@linutronix.de, m.szyprowski@samsung.com Reply-To: bigeasy@linutronix.de, brad.mouring@ni.com, hpa@zytor.com, rcochran@linutronix.de, linux@arm.linux.org.uk, mingo@kernel.org, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, anna-maria@linutronix.de, linus.walleij@linaro.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, robh@kernel.org In-Reply-To: <20160713153336.801270887@linutronix.de> References: <20160713153336.801270887@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] arm/l2c: Convert to hotplug state machine Git-Commit-ID: 9eeb2264775f0b60fcff3d186bf54c90b0191650 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: 9eeb2264775f0b60fcff3d186bf54c90b0191650 Gitweb: http://git.kernel.org/tip/9eeb2264775f0b60fcff3d186bf54c90b0191650 Author: Richard Cochran AuthorDate: Wed, 13 Jul 2016 17:16:50 +0000 Committer: Ingo Molnar CommitDate: Fri, 15 Jul 2016 10:40:28 +0200 arm/l2c: Convert to hotplug state machine Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Richard Cochran Signed-off-by: Anna-Maria Gleixner Reviewed-by: Sebastian Andrzej Siewior Cc: Brad Mouring Cc: Linus Torvalds Cc: Linus Walleij Cc: Marek Szyprowski Cc: Peter Zijlstra Cc: Rob Herring Cc: Russell King Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153336.801270887@linutronix.de Signed-off-by: Ingo Molnar --- arch/arm/mm/cache-l2x0.c | 27 +++++++++++++-------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index c61996c..cc12905 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -597,17 +597,16 @@ static void l2c310_configure(void __iomem *base) L310_POWER_CTRL); } -static int l2c310_cpu_enable_flz(struct notifier_block *nb, unsigned long act, void *data) +static int l2c310_starting_cpu(unsigned int cpu) { - switch (act & ~CPU_TASKS_FROZEN) { - case CPU_STARTING: - set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1)); - break; - case CPU_DYING: - set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1))); - break; - } - return NOTIFY_OK; + set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1)); + return 0; +} + +static int l2c310_dying_cpu(unsigned int cpu) +{ + set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1))); + return 0; } static void __init l2c310_enable(void __iomem *base, unsigned num_lock) @@ -678,10 +677,10 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock) power_ctrl & L310_STNDBY_MODE_EN ? "en" : "dis"); } - if (aux & L310_AUX_CTRL_FULL_LINE_ZERO) { - set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1)); - cpu_notifier(l2c310_cpu_enable_flz, 0); - } + if (aux & L310_AUX_CTRL_FULL_LINE_ZERO) + cpuhp_setup_state(CPUHP_AP_ARM_L2X0_STARTING, + "AP_ARM_L2X0_STARTING", l2c310_starting_cpu, + l2c310_dying_cpu); } static void __init l2c310_fixup(void __iomem *base, u32 cache_id, diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 990052c..2057e64 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -37,6 +37,7 @@ enum cpuhp_state { CPUHP_AP_PERF_METAG_STARTING, CPUHP_AP_ARM_VFP_STARTING, CPUHP_AP_PERF_ARM_STARTING, + CPUHP_AP_ARM_L2X0_STARTING, CPUHP_AP_ARM_ARCH_TIMER_STARTING, CPUHP_AP_DUMMY_TIMER_STARTING, CPUHP_AP_METAG_TIMER_STARTING,