From: "tip-bot2 for Anna-Maria Behnsen" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Anna-Maria Behnsen" <anna-maria@linutronix.de>,
Thomas Gleixner <tglx@linutronix.de>,
John Stultz <jstultz@google.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] timekeeping: Introduce tkd_basic_setup() to make lock and seqcount init reusable
Date: Fri, 25 Oct 2024 14:53:54 -0000 [thread overview]
Message-ID: <172986803401.1442.2735708155036370167.tip-bot2@tip-bot2> (raw)
In-Reply-To: =?utf-8?q?=3C20241009-devel-anna-maria-b4-timers-ptp-timekeepin?= =?utf-8?q?g-v2-11-554456a44a15=40linutronix=2Ede=3E?=
The following commit has been merged into the timers/core branch of tip:
Commit-ID: e202a13aea0cc80266604f3cdbcab9d9b5592a9b
Gitweb: https://git.kernel.org/tip/e202a13aea0cc80266604f3cdbcab9d9b5592a9b
Author: Anna-Maria Behnsen <anna-maria@linutronix.de>
AuthorDate: Wed, 09 Oct 2024 10:29:04 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 25 Oct 2024 16:41:12 +02:00
timekeeping: Introduce tkd_basic_setup() to make lock and seqcount init reusable
Initialization of lock and seqcount needs to be done for every instance of
timekeeper struct. To be able to easily reuse it, create a separate
function for it.
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20241009-devel-anna-maria-b4-timers-ptp-timekeeping-v2-11-554456a44a15@linutronix.de
---
kernel/time/timekeeping.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index d520c11..cd83dea 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1765,6 +1765,12 @@ read_persistent_wall_and_boot_offset(struct timespec64 *wall_time,
*boot_offset = ns_to_timespec64(local_clock());
}
+static __init void tkd_basic_setup(struct tk_data *tkd)
+{
+ raw_spin_lock_init(&tkd->lock);
+ seqcount_raw_spinlock_init(&tkd->seq, &tkd->lock);
+}
+
/*
* Flag reflecting whether timekeeping_resume() has injected sleeptime.
*
@@ -1792,8 +1798,7 @@ void __init timekeeping_init(void)
struct timekeeper *tk = &tk_core.timekeeper;
struct clocksource *clock;
- raw_spin_lock_init(&tk_core.lock);
- seqcount_raw_spinlock_init(&tk_core.seq, &tkd->lock);
+ tkd_basic_setup(&tk_core);
read_persistent_wall_and_boot_offset(&wall_time, &boot_offset);
if (timespec64_valid_settod(&wall_time) &&
next reply other threads:[~2024-10-25 14:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 14:53 tip-bot2 for Anna-Maria Behnsen [this message]
2024-10-25 18:01 tip-bot2 for Anna-Maria Behnsen
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=172986803401.1442.2735708155036370167.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®