[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-d67f34c19a679436dd2963b588015e119279e7a8@git.kernel.org>
Date: Thu, 4 Oct 2018 14:03:56 -0700
From: tip-bot for Thomas Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jgross@...e.com, john.stultz@...aro.org, fweimer@...hat.com,
vkuznets@...hat.com, luto@...nel.org, tglx@...utronix.de,
hpa@...or.com, linux-kernel@...r.kernel.org, sboyd@...nel.org,
matt@...trans.com.au, mingo@...nel.org, pbonzini@...hat.com,
kys@...rosoft.com, arnd@...db.de, peterz@...radead.org
Subject: [tip:x86/vdso] clocksource: Provide clocksource_arch_init()
Commit-ID: d67f34c19a679436dd2963b588015e119279e7a8
Gitweb: https://git.kernel.org/tip/d67f34c19a679436dd2963b588015e119279e7a8
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon, 17 Sep 2018 14:45:34 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 4 Oct 2018 23:00:24 +0200
clocksource: Provide clocksource_arch_init()
Architectures have extra archdata in the clocksource, e.g. for VDSO
support. There are no sanity checks or general initializations for this
available. Add support for that.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Andy Lutomirski <luto@...nel.org>
Acked-by: John Stultz <john.stultz@...aro.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Matt Rickard <matt@...trans.com.au>
Cc: Stephen Boyd <sboyd@...nel.org>
Cc: Florian Weimer <fweimer@...hat.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: devel@...uxdriverproject.org
Cc: virtualization@...ts.linux-foundation.org
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Juergen Gross <jgross@...e.com>
Link: https://lkml.kernel.org/r/20180917130706.973042587@linutronix.de
---
include/linux/clocksource.h | 5 +++++
kernel/time/Kconfig | 4 ++++
kernel/time/clocksource.c | 2 ++
3 files changed, 11 insertions(+)
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 308918928767..6e6b86f9046d 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -241,6 +241,11 @@ static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz
__clocksource_update_freq_scale(cs, 1000, khz);
}
+#ifdef CONFIG_ARCH_CLOCKSOURCE_INIT
+extern void clocksource_arch_init(struct clocksource *cs);
+#else
+static inline void clocksource_arch_init(struct clocksource *cs) { }
+#endif
extern int timekeeping_notify(struct clocksource *clock);
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 78eabc41eaa6..58b981f4bb5d 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -12,6 +12,10 @@ config CLOCKSOURCE_WATCHDOG
config ARCH_CLOCKSOURCE_DATA
bool
+# Architecture has extra clocksource init called from registration
+config ARCH_CLOCKSOURCE_INIT
+ bool
+
# Clocksources require validation of the clocksource against the last
# cycle update - x86/TSC misfeature
config CLOCKSOURCE_VALIDATE_LAST_CYCLE
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 0e6e97a01942..ffe081623aec 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -937,6 +937,8 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
{
unsigned long flags;
+ clocksource_arch_init(cs);
+
/* Initialize mult/shift and max_idle_ns */
__clocksource_update_freq_scale(cs, scale, freq);
Powered by blists - more mailing lists