From: Anna-Maria Gleixner <anna-maria@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
rt@linutronix.de, Richard Cochran <rcochran@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Anna-Maria Gleixner <anna-maria@linutronix.de>
Subject: [patch V2 42/67] clocksource/mips-gic: Convert to hotplug state machine
Date: Wed, 13 Jul 2016 17:16:44 -0000 [thread overview]
Message-ID: <20160713153336.380737946@linutronix.de> (raw)
In-Reply-To: 20160713153219.128052238@linutronix.de
[-- Attachment #1: 0041-clocksource-mips-gic-Convert-to-hotplug-state-machin.patch --]
[-- Type: text/plain, Size: 3270 bytes --]
From: Richard Cochran <rcochran@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
drivers/clocksource/mips-gic-timer.c | 38 ++++++++++++------------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 1572c7a..d91e872 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -49,10 +49,9 @@ struct irqaction gic_compare_irqaction = {
.name = "timer",
};
-static void gic_clockevent_cpu_init(struct clock_event_device *cd)
+static void gic_clockevent_cpu_init(unsigned int cpu,
+ struct clock_event_device *cd)
{
- unsigned int cpu = smp_processor_id();
-
cd->name = "MIPS GIC";
cd->features = CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_C3STOP;
@@ -79,19 +78,10 @@ static void gic_update_frequency(void *data)
clockevents_update_freq(this_cpu_ptr(&gic_clockevent_device), rate);
}
-static int gic_cpu_notifier(struct notifier_block *nb, unsigned long action,
- void *data)
+static int gic_starting_cpu(unsigned int cpu)
{
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_STARTING:
- gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
- break;
- case CPU_DYING:
- gic_clockevent_cpu_exit(this_cpu_ptr(&gic_clockevent_device));
- break;
- }
-
- return NOTIFY_OK;
+ gic_clockevent_cpu_init(cpu, this_cpu_ptr(&gic_clockevent_device));
+ return 0;
}
static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
@@ -105,10 +95,11 @@ static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
return NOTIFY_OK;
}
-
-static struct notifier_block gic_cpu_nb = {
- .notifier_call = gic_cpu_notifier,
-};
+static int gic_dying_cpu(unsigned int cpu)
+{
+ gic_clockevent_cpu_exit(this_cpu_ptr(&gic_clockevent_device));
+ return 0;
+}
static struct notifier_block gic_clk_nb = {
.notifier_call = gic_clk_notifier,
@@ -125,12 +116,9 @@ static int gic_clockevent_init(void)
if (ret < 0)
return ret;
- ret = register_cpu_notifier(&gic_cpu_nb);
- if (ret < 0)
- pr_warn("GIC: Unable to register CPU notifier\n");
-
- gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
-
+ cpuhp_setup_state(CPUHP_AP_MIPS_GIC_TIMER_STARTING,
+ "AP_MIPS_GIC_TIMER_STARTING", gic_starting_cpu,
+ gic_dying_cpu);
return 0;
}
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 5121ec1..c052b04 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -41,6 +41,7 @@ enum cpuhp_state {
CPUHP_AP_DUMMY_TIMER_STARTING,
CPUHP_AP_METAG_TIMER_STARTING,
CPUHP_AP_QCOM_TIMER_STARTING,
+ CPUHP_AP_MIPS_GIC_TIMER_STARTING,
CPUHP_AP_KVM_STARTING,
CPUHP_AP_NOTIFY_STARTING,
CPUHP_AP_ONLINE,
--
2.8.1
next prev parent reply other threads:[~2016-07-13 17:21 UTC|newest]
Thread overview: 170+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 17:16 [patch V2 00/67] cpuhotplug: Convert all priority notifiers to the state machine Anna-Maria Gleixner
2016-07-13 17:16 ` [patch V2 02/67] x86/vdso: Convert to hotplug " Anna-Maria Gleixner
2016-07-19 6:58 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 01/67] cpuhotplug: Handle early registration gracefully Anna-Maria Gleixner
2016-07-19 6:57 ` [tip:smp/hotplug] cpu/hotplug: " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 03/67] irqchip/gic: Convert to hotplug state machine Anna-Maria Gleixner
2016-07-19 6:58 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 04/67] irqchip/gicv3: " Anna-Maria Gleixner
2016-07-19 6:59 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 05/67] irqchip/hip04: " Anna-Maria Gleixner
2016-07-19 6:59 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 07/67] irqchip/bcm2836: " Anna-Maria Gleixner
2016-07-19 7:00 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 06/67] irqchip/armada-370-xp: " Anna-Maria Gleixner
2016-07-19 7:00 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 08/67] ARM: mvebu: " Anna-Maria Gleixner
2016-07-19 7:01 ` [tip:smp/hotplug] ARM/mvebu: " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 09/67] perf/core: " Anna-Maria Gleixner
2016-07-19 7:01 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 10/67] perf/x86: Convert the core to the " Anna-Maria Gleixner
2016-07-19 7:02 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 11/67] perf/x86/intel/uncore: Convert to " Anna-Maria Gleixner
2016-07-19 7:02 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 12/67] perf/x86/amd/uncore: " Anna-Maria Gleixner
2016-07-19 7:03 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 13/67] perf/x86/amd/ibs: " Anna-Maria Gleixner
2016-07-19 7:03 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 14/67] perf/x86/intel/rapl: " Anna-Maria Gleixner
2016-07-19 7:04 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 15/67] perf/x86/intel/cqm: Convert Intel CQM " Anna-Maria Gleixner
2016-07-19 7:04 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 16/67] perf/x86/intel/cstate: Convert Intel CSTATE " Anna-Maria Gleixner
2016-07-19 7:05 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 17/67] blackfin/perf: Convert hotplug notifier to " Anna-Maria Gleixner
2016-07-19 7:05 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 18/67] powerpc/perf: Convert book3s notifier to state machine callbacks Anna-Maria Gleixner
2016-07-19 7:06 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 19/67] s390/perf: Convert the hotplug notifier to state machine callbacks (Counter) Anna-Maria Gleixner
2016-07-19 7:07 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 20/67] s390/perf: Convert the hotplug notifier to state machine callbacks (Sampling) Anna-Maria Gleixner
2016-07-19 7:07 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 21/67] sh/perf: Convert the hotplug notifiers to state machine callbacks Anna-Maria Gleixner
2016-07-19 7:07 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 22/67] bus/arm-cci: Convert to hotplug statemachine Anna-Maria Gleixner
2016-07-15 12:38 ` Punit Agrawal
2016-07-19 7:08 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 23/67] bus/arm-ccn: " Anna-Maria Gleixner
2016-07-18 18:37 ` Pawel Moll
2016-07-19 7:09 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 24/67] xtensa/perf: Convert the hotplug notifier to state machine callbacks Anna-Maria Gleixner
2016-07-19 7:09 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 25/67] perf/x86/amd/power: Change hotplug notifier to a symmetric structure Anna-Maria Gleixner
2016-07-19 7:10 ` [tip:smp/hotplug] " tip-bot for Anna-Maria Gleixner
2016-07-13 17:16 ` [patch V2 26/67] perf/x86/amd/power: Convert the hotplug notifier to state machine Anna-Maria Gleixner
2016-07-19 7:11 ` [tip:smp/hotplug] " tip-bot for Anna-Maria Gleixner
2016-07-13 17:16 ` [patch V2 27/67] perf/core: Remove perf CPU notifier code Anna-Maria Gleixner
2016-07-19 7:11 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 28/67] workqueue: Convert to state machine callbacks Anna-Maria Gleixner
2016-07-19 7:12 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 29/67] x86/hpet: Convert to hotplug state machine Anna-Maria Gleixner
2016-07-19 7:13 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 30/67] powerpc/numa: " Anna-Maria Gleixner
2016-07-14 21:42 ` Anton Blanchard
2016-07-14 23:37 ` Anna-Maria Gleixner
2016-07-15 0:28 ` Anton Blanchard
2016-07-15 8:43 ` Ingo Molnar
2016-07-15 12:14 ` Anton Blanchard
2016-07-15 16:20 ` Sebastian Andrzej Siewior
2016-07-18 14:07 ` [PATCH v2] " Sebastian Andrzej Siewior
2016-07-22 19:57 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 31/67] KVM/x86: Remove superfluous SMP function call Anna-Maria Gleixner
2016-07-14 8:21 ` Paolo Bonzini
2016-07-19 7:13 ` [tip:smp/hotplug] " tip-bot for Anna-Maria Gleixner
2016-07-13 17:16 ` [patch V2 32/67] x86/kvm/kvmclock: Convert to hotplug state machine Anna-Maria Gleixner
2016-07-19 7:14 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 33/67] x86/apb_timer: " Anna-Maria Gleixner
2016-07-19 7:14 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 34/67] arm: Convert VFP hotplug notifiers to " Anna-Maria Gleixner
2016-07-19 7:15 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 35/67] arm/perf: Convert to hotplug " Anna-Maria Gleixner
2016-07-15 13:08 ` Mark Rutland
2016-07-15 15:26 ` Sebastian Andrzej Siewior
2016-07-15 16:16 ` Mark Rutland
2016-07-19 7:16 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-19 7:35 ` Sebastian Andrzej Siewior
2016-07-19 7:48 ` Ingo Molnar
2016-07-19 9:02 ` [PATCH v2] " Sebastian Andrzej Siewior
2016-07-19 9:57 ` Mark Rutland
2016-07-19 11:17 ` [PATCH v3] " Sebastian Andrzej Siewior
2016-07-20 8:01 ` Ingo Molnar
2016-07-20 10:41 ` [tip:smp/hotplug] arm/perf: Fix hotplug state machine conversion tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 36/67] virt: Convert kvm hotplug to state machine Anna-Maria Gleixner
2016-07-19 7:16 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 37/67] ACPI/processor: Avoid STARTING/DYING actions in a more logical way Anna-Maria Gleixner
2016-07-19 7:17 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 38/67] clocksource/arm_arch_timer: Convert to hotplug state machine Anna-Maria Gleixner
2016-07-19 7:17 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 39/67] clocksource/dummy_timer: " Anna-Maria Gleixner
2016-07-19 7:18 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 40/67] clocksource/metag: " Anna-Maria Gleixner
2016-07-19 7:19 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 41/67] clocksource/qcom-timer: " Anna-Maria Gleixner
2016-07-19 7:19 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` Anna-Maria Gleixner [this message]
2016-07-19 7:20 ` [tip:smp/hotplug] clocksource/mips-gic: " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 43/67] leds/trigger/cpu: " Anna-Maria Gleixner
2016-07-14 7:19 ` Jacek Anaszewski
2016-07-14 7:47 ` Ingo Molnar
2016-07-14 8:10 ` Jacek Anaszewski
2016-07-14 9:41 ` Peter Zijlstra
2016-07-14 11:23 ` Jacek Anaszewski
2016-07-14 11:33 ` Thomas Gleixner
2016-07-14 11:55 ` Jacek Anaszewski
2016-07-15 14:10 ` Sebastian Andrzej Siewior
2016-07-18 8:26 ` Jacek Anaszewski
2016-07-19 7:20 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 44/67] arm/kvm/vgic: " Anna-Maria Gleixner
2016-07-19 7:21 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 45/67] arm/kvm/arch_timer: " Anna-Maria Gleixner
2016-07-19 7:21 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 46/67] metag/perf: " Anna-Maria Gleixner
2016-07-19 7:22 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 47/67] arm/l2c: " Anna-Maria Gleixner
2016-07-19 7:22 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 48/67] arm/twd: " Anna-Maria Gleixner
2016-07-19 7:23 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 49/67] arm/xen: " Anna-Maria Gleixner
2016-07-13 18:21 ` Stefano Stabellini
2016-07-19 7:23 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 50/67] MIPS/Loongson-3: Convert oprofile " Anna-Maria Gleixner
2016-07-19 7:24 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 51/67] hwtracing/coresight-etm3x: Convert " Anna-Maria Gleixner
2016-07-19 7:24 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 52/67] hwtracing/coresight-etm4x: " Anna-Maria Gleixner
2016-07-19 7:25 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 53/67] arm64/armv8 deprecated: " Anna-Maria Gleixner
2016-07-19 7:25 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 54/67] x86/tboot: " Anna-Maria Gleixner
2016-07-19 7:26 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:16 ` [patch V2 55/67] hrtimer: " Anna-Maria Gleixner
2016-07-19 7:26 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:16 ` [patch V2 57/67] profile: " Anna-Maria Gleixner
2016-07-19 7:27 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:16 ` [patch V2 56/67] timers/core: " Anna-Maria Gleixner
2016-07-19 7:27 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-27 9:08 ` [PATCH] timers/core: Correct callback order during CPU hot plug Richard Cochran
2016-07-27 9:50 ` Jon Hunter
2016-07-28 15:34 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-28 16:57 ` tip-bot for Richard Cochran
2016-07-13 17:17 ` [patch V2 58/67] x86/x2apic: Convert to CPU hotplug state machine Anna-Maria Gleixner
2016-07-19 7:28 ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-07-13 17:17 ` [patch V2 59/67] smp: Convert core to " Anna-Maria Gleixner
2016-07-19 7:28 ` [tip:smp/hotplug] smp/cfd: " tip-bot for Richard Weinberger
2016-07-13 17:17 ` [patch V2 60/67] KVM/arm/arm64/vgic-new: Convert " Anna-Maria Gleixner
2016-07-14 13:08 ` Marc Zyngier
2016-07-19 7:29 ` [tip:smp/hotplug] " tip-bot for Anna-Maria Gleixner
2016-07-13 17:17 ` [patch V2 61/67] rcu: Convert rcutree " Anna-Maria Gleixner
2016-07-19 7:29 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2016-07-13 17:17 ` [patch V2 62/67] [PATCH] clocksource: arm_global_timer: Convert " Anna-Maria Gleixner
2016-07-19 7:30 ` [tip:smp/hotplug] clocksource/arm_global_timer: " tip-bot for Richard Cochran
2016-07-13 17:17 ` [patch V2 63/67] clocksource/exynos_mct: " Anna-Maria Gleixner
2016-07-19 7:31 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:17 ` [patch V2 64/67] clocksource/armada-370-xp: " Anna-Maria Gleixner
2016-07-19 7:31 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:17 ` [patch V2 65/67] clocksource/atlas7: " Anna-Maria Gleixner
2016-07-19 7:32 ` [tip:smp/hotplug] " tip-bot for Richard Cochran
2016-07-13 17:17 ` [patch V2 66/67] ARC/time: " Anna-Maria Gleixner
2016-07-19 7:32 ` [tip:smp/hotplug] " tip-bot for Anna-Maria Gleixner
2016-07-13 17:17 ` [patch V2 67/67] cpuhotplug: Remove CPU_STARTING and CPU_DYING notifier Anna-Maria Gleixner
2016-07-13 19:32 ` [patch V2 00/67] cpuhotplug: Convert all priority notifiers to the state machine Jason Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160713153336.380737946@linutronix.de \
--to=anna-maria@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rcochran@linutronix.de \
--cc=rt@linutronix.de \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).