summaryrefslogtreecommitdiffstats
path: root/include/linux/tick.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-04-03 02:05:15 +0200
committerIngo Molnar <mingo@kernel.org>2015-04-03 08:44:33 +0200
commit1fe5d5c3c9ba0c4ade18e3325cba0ffe35127941 (patch)
treeb07d74d6468aa0bf1e2b107bb82d62b9fe6638d4 /include/linux/tick.h
parent89feddbfe7023ccfb4a6d7f5e3f5161d91b28b18 (diff)
downloadop-kernel-dev-1fe5d5c3c9ba0c4ade18e3325cba0ffe35127941.zip
op-kernel-dev-1fe5d5c3c9ba0c4ade18e3325cba0ffe35127941.tar.gz
clockevents: Provide explicit broadcast oneshot control functions
clockevents_notify() is a leftover from the early design of the clockevents facility. It's really not a notification mechanism, it's a multiplex call. We are way better off to have explicit calls instead of this monstrosity. Split out the broadcast oneshot control into a separate function and provide inline helpers. Switch clockevents_notify() over. This will go away once all callers are converted. This also gets rid of the nested locking of clockevents_lock and broadcast_lock. The broadcast oneshot control functions do not require clockevents_lock. Only the managing functions (setup/shutdown/suspend/resume of the broadcast device require clockevents_lock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Len Brown <lenb@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Link: http://lkml.kernel.org/r/13000649.8qZuEDV0OA@vostro.rjw.lan Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/tick.h')
-rw-r--r--include/linux/tick.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 4bb2363..6119321 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -48,12 +48,23 @@ enum tick_broadcast_mode {
TICK_BROADCAST_FORCE,
};
+enum tick_broadcast_state {
+ TICK_BROADCAST_EXIT,
+ TICK_BROADCAST_ENTER,
+};
+
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
extern void tick_broadcast_control(enum tick_broadcast_mode mode);
#else
static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { }
#endif /* BROADCAST */
+#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)
+extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state);
+#else
+static inline int tick_broadcast_oneshot_control(enum tick_broadcast_state state) { return 0; }
+#endif
+
static inline void tick_broadcast_enable(void)
{
tick_broadcast_control(TICK_BROADCAST_ON);
@@ -66,6 +77,14 @@ static inline void tick_broadcast_force(void)
{
tick_broadcast_control(TICK_BROADCAST_FORCE);
}
+static inline int tick_broadcast_enter(void)
+{
+ return tick_broadcast_oneshot_control(TICK_BROADCAST_ENTER);
+}
+static inline void tick_broadcast_exit(void)
+{
+ tick_broadcast_oneshot_control(TICK_BROADCAST_EXIT);
+}
#ifdef CONFIG_NO_HZ_COMMON
extern int tick_nohz_tick_stopped(void);
OpenPOWER on IntegriCloud