[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210928235635.1348330-3-willmcvicker@google.com>
Date: Tue, 28 Sep 2021 23:56:19 +0000
From: Will McVicker <willmcvicker@...gle.com>
To: Russell King <linux@...linux.org.uk>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
Tomasz Figa <tomasz.figa@...il.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Linus Walleij <linus.walleij@...aro.org>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Lee Jones <lee.jones@...aro.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Saravana Kannan <saravanak@...gle.com>,
Will McVicker <willmcvicker@...gle.com>,
kernel-team@...roid.com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-clk@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-rtc@...r.kernel.org
Subject: [PATCH v2 02/12] timekeeping: add API for getting timekeeping_suspended
This allows modules to access the value of timekeeping_suspended without
giving them write access to the variable.
Signed-off-by: Will McVicker <willmcvicker@...gle.com>
---
include/linux/timekeeping.h | 1 +
kernel/time/timekeeping.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 78a98bdff76d..cdc84421d77b 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -8,6 +8,7 @@
/* Included from linux/ktime.h */
void timekeeping_init(void);
+extern bool timekeeping_is_suspended(void);
extern int timekeeping_suspended;
/* Architecture timer tick functions: */
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index b348749a9fc6..27873c052e57 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -57,6 +57,17 @@ static struct timekeeper shadow_timekeeper;
/* flag for if timekeeping is suspended */
int __read_mostly timekeeping_suspended;
+/**
+ * timekeeping_is_suspended - query for timekeeping_suspended
+ *
+ * Returns the true/false based on the value of timekeeping_suspened.
+ */
+bool timekeeping_is_suspended(void)
+{
+ return timekeeping_suspended ? true : false;
+}
+EXPORT_SYMBOL_GPL(timekeeping_is_suspended);
+
/**
* struct tk_fast - NMI safe timekeeper
* @seq: Sequence counter for protecting updates. The lowest bit
--
2.33.0.685.g46640cef36-goog
Powered by blists - more mailing lists