[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175129591888.406.15810387280877920988.tip-bot2@tip-bot2>
Date: Mon, 30 Jun 2025 15:05:18 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, John Stultz <jstultz@...gle.com>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
[tip: timers/ptp] timekeeping: Provide adjtimex() for auxiliary clocks
The following commit has been merged into the timers/ptp branch of tip:
Commit-ID: ecf3e70304911be1c14cd21baa0bc611a53ec50b
Gitweb: https://git.kernel.org/tip/ecf3e70304911be1c14cd21baa0bc611a53ec50b
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Wed, 25 Jun 2025 20:38:46 +02:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Fri, 27 Jun 2025 20:13:13 +02:00
timekeeping: Provide adjtimex() for auxiliary clocks
The behaviour is close to clock_adtime(CLOCK_REALTIME) with the
following differences:
1) ADJ_SETOFFSET adjusts the auxiliary clock offset
2) ADJ_TAI is not supported
3) Leap seconds are not supported
4) PPS is not supported
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: John Stultz <jstultz@...gle.com>
Link: https://lore.kernel.org/all/20250625183758.317946543@linutronix.de
---
kernel/time/timekeeping.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 6770544..523670e 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2875,10 +2875,26 @@ static int aux_clock_set(const clockid_t id, const struct timespec64 *tnew)
return 0;
}
+static int aux_clock_adj(const clockid_t id, struct __kernel_timex *txc)
+{
+ struct tk_data *aux_tkd = aux_get_tk_data(id);
+ struct adjtimex_result result = { };
+
+ if (!aux_tkd)
+ return -ENODEV;
+
+ /*
+ * @result is ignored for now as there are neither hrtimers nor a
+ * RTC related to auxiliary clocks for now.
+ */
+ return __do_adjtimex(aux_tkd, txc, &result);
+}
+
const struct k_clock clock_aux = {
.clock_getres = aux_get_res,
.clock_get_timespec = aux_get_timespec,
.clock_set = aux_clock_set,
+ .clock_adj = aux_clock_adj,
};
static __init void tk_aux_setup(void)
Powered by blists - more mailing lists