From: "tip-bot2 for Thomas Gleixner" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
Thomas Gleixner <tglx@kernel.org>,
stable@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: [tip: timers/core] time/jiffies: Register jiffies clocksource before usage
Date: Sat, 13 Jun 2026 13:28:07 -0000 [thread overview]
Message-ID: <178135728754.1650852.1266320590541376793.tip-bot2@tip-bot2> (raw)
In-Reply-To: <87y0gn3fve.ffs@fw13>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: f24df84cbe05e4471c04ac4b921fc0340bbc7752
Gitweb: https://git.kernel.org/tip/f24df84cbe05e4471c04ac4b921fc0340bbc7752
Author: Thomas Gleixner <tglx@kernel.org>
AuthorDate: Tue, 09 Jun 2026 17:14:45 +02:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sat, 13 Jun 2026 15:22:40 +02:00
time/jiffies: Register jiffies clocksource before usage
Teddy reported that a XEN HVM has a long boot delay, which was bisected to
the recent enhancements to the negative motion detection. It turned out
that the jiffies clocksource is used in early boot before it is registered,
which leaves the max_delta_raw field at zero. That causes the read out to
be clamped to the max delta of 0, which means time is not making progress.
Cure it by ensuring that it is initialized before its first usage in
timekeeping_init().
Fixes: 76031d9536a0 ("clocksource: Make negative motion detection more robust")
Reported-by: Teddy Astie <teddy.astie@vates.tech>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Teddy Astie <teddy.astie@vates.tech>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/87y0gn3fve.ffs@fw13
Closes: https://lore.kernel.org/all/1780914594.8631fc262581453bbf619ec5b2062170.19ea6c8227b000701b@vates.tech
---
kernel/time/jiffies.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
index 1c954f3..d514288 100644
--- a/kernel/time/jiffies.c
+++ b/kernel/time/jiffies.c
@@ -60,15 +60,14 @@ EXPORT_SYMBOL(get_jiffies_64);
EXPORT_SYMBOL(jiffies);
-static int __init init_jiffies_clocksource(void)
-{
- return __clocksource_register(&clocksource_jiffies);
-}
-
-core_initcall(init_jiffies_clocksource);
+static bool cs_jiffies_registered __initdata;
struct clocksource * __init __weak clocksource_default_clock(void)
{
+ if (!cs_jiffies_registered) {
+ __clocksource_register(&clocksource_jiffies);
+ cs_jiffies_registered = true;
+ }
return &clocksource_jiffies;
}
next prev parent reply other threads:[~2026-06-13 13:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 10:29 [REGRESSION][BISECTED] Long boot time with Xen HVM guests during PV spinlock initialization Teddy Astie
2026-06-08 10:57 ` Juergen Gross
2026-06-08 15:13 ` Thomas Gleixner
2026-06-08 21:29 ` Thomas Gleixner
2026-06-09 9:27 ` Teddy Astie
2026-06-09 15:14 ` Thomas Gleixner
2026-06-12 9:02 ` Teddy Astie
2026-06-13 13:28 ` tip-bot2 for Thomas Gleixner [this message]
[not found] ` <CGME20260616184701eucas1p13c7aff447073832095aa4adfb85935f0@eucas1p1.samsung.com>
2026-06-16 18:47 ` [tip: timers/core] time/jiffies: Register jiffies clocksource before usage Marek Szyprowski
2026-06-17 14:17 ` Conor Dooley
2026-06-17 15:04 ` Thomas Gleixner
2026-06-17 15:04 ` Thomas Gleixner
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=178135728754.1650852.1266320590541376793.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=teddy.astie@vates.tech \
--cc=tglx@kernel.org \
--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®