Commit 9eeb2264 authored by Richard Cochran's avatar Richard Cochran Committed by Ingo Molnar

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: default avatarRichard Cochran <rcochran@linutronix.de>
Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Brad Mouring <brad.mouring@ni.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153336.801270887@linutronix.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 04d045a6
...@@ -597,17 +597,16 @@ static void l2c310_configure(void __iomem *base) ...@@ -597,17 +597,16 @@ static void l2c310_configure(void __iomem *base)
L310_POWER_CTRL); 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) { set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
case CPU_STARTING: return 0;
set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1)); }
break;
case CPU_DYING: static int l2c310_dying_cpu(unsigned int cpu)
set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1))); {
break; set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1)));
} return 0;
return NOTIFY_OK;
} }
static void __init l2c310_enable(void __iomem *base, unsigned num_lock) 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) ...@@ -678,10 +677,10 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
power_ctrl & L310_STNDBY_MODE_EN ? "en" : "dis"); power_ctrl & L310_STNDBY_MODE_EN ? "en" : "dis");
} }
if (aux & L310_AUX_CTRL_FULL_LINE_ZERO) { if (aux & L310_AUX_CTRL_FULL_LINE_ZERO)
set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1)); cpuhp_setup_state(CPUHP_AP_ARM_L2X0_STARTING,
cpu_notifier(l2c310_cpu_enable_flz, 0); "AP_ARM_L2X0_STARTING", l2c310_starting_cpu,
} l2c310_dying_cpu);
} }
static void __init l2c310_fixup(void __iomem *base, u32 cache_id, static void __init l2c310_fixup(void __iomem *base, u32 cache_id,
......
...@@ -37,6 +37,7 @@ enum cpuhp_state { ...@@ -37,6 +37,7 @@ enum cpuhp_state {
CPUHP_AP_PERF_METAG_STARTING, CPUHP_AP_PERF_METAG_STARTING,
CPUHP_AP_ARM_VFP_STARTING, CPUHP_AP_ARM_VFP_STARTING,
CPUHP_AP_PERF_ARM_STARTING, CPUHP_AP_PERF_ARM_STARTING,
CPUHP_AP_ARM_L2X0_STARTING,
CPUHP_AP_ARM_ARCH_TIMER_STARTING, CPUHP_AP_ARM_ARCH_TIMER_STARTING,
CPUHP_AP_DUMMY_TIMER_STARTING, CPUHP_AP_DUMMY_TIMER_STARTING,
CPUHP_AP_METAG_TIMER_STARTING, CPUHP_AP_METAG_TIMER_STARTING,
......
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