mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: John Stultz <jstultz@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Miroslav Lichvar <mlichvar@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] timekeeping: Initialize TAI offset to 37 seconds
Date: Thu,  5 Nov 2026 14:53:15 +0100	[thread overview]
Message-ID: <20261105135316.2465369-1-mlichvar@redhat.com> (raw)

With Resolution 5 of the 28th CGPM (continuous UTC becoming effective on
20 May 2027) [1] and no leap second announced for the last possible
date at the end of the year 2026 [2], no more leap seconds or other
leaps in UTC are expected for at least a few hundred years. The TAI-UTC
offset can be assumed now to be constant (37 seconds).

Set the offset in the timekeeping initialization to the expected value
to not require it to be set in user space via ADJ_TAI. It can still be
changed, and leap seconds can still be set, but nothing should be
expected to do that anymore. Existing applications are expected to
either set the offset to the same value, or not touch it at all if they
see it is not zero.

[1] https://www.bipm.org/en/cgpm-2026/resolution-5
[2] https://datacenter.iers.org/data/16/bulletinc-072.txt

Cc: Richard Cochran <richardcochran@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
---
 kernel/time/timekeeping.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index dcf47f1ffdcf..e76e44b194da 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -34,6 +34,8 @@
 
 #define TK_UPDATE_ALL		(TK_CLEAR_NTP | TK_CLOCK_WAS_SET)
 
+#define TK_INITIAL_TAI_OFFSET	37
+
 enum timekeeping_adv_mode {
 	/* Update timekeeper when a tick has passed */
 	TK_ADV_TICK,
@@ -2091,6 +2093,8 @@ void __init timekeeping_init(void)
 
 	tk_set_wall_to_mono(tks, wall_to_mono);
 
+	__timekeeping_set_tai_offset(tks, TK_INITIAL_TAI_OFFSET);
+
 	/*
 	 * Use TK_UPDATE_ALL so the NTP layer picks up the clocksource's
 	 * cs_tick_adj via ntp_clear(). Clearing NTP here is otherwise
-- 
2.56.0


             reply	other threads:[~2026-11-05 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 13:53 Miroslav Lichvar [this message]
2026-11-05 16:00 ` David Woodhouse
2026-11-05 19:42 ` John Stultz

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=20261105135316.2465369-1-mlichvar@redhat.com \
    --to=mlichvar@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@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®