From nobody Mon Jun 8 03:20:28 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A0513D9DA7; Tue, 2 Jun 2026 09:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780393572; cv=none; b=lIQoU8WnlOK40r/yladgujxZUDKDlskHLqEucIUcSgydK+dDaB2i23QVcf5UdL9Ikzr/TjqBeEKmYnOGV+9U3xzHl2dQkPa1mEknUabvoziH+mjIwzagQHuhJLFC2EplIGTSkSWNjGrvZKLmdYL7MQd0i2t6lQ/W41OCUfd/uCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780393572; c=relaxed/simple; bh=E3Q0SQHENulL+26bE3x8RHB9CACsmW08abhiPikVii0=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=t2yn3w9cK2ogEXr4op3V+W2UlIFvqpw8uAExXTUCUzQSOx4JHdStuA9gRsx/+yaaO8dZVqnlu4o+kXz8vktxjauR7L2D/BDSb6hgLF9a6CzKphcj4o74i9GV4/MaLb2PuUWJPPXBtYZVWgnbilORkSXeFJDXar662f/MyJHcDMU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=enKTHW+7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JH6Vd2+O; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="enKTHW+7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JH6Vd2+O" Date: Tue, 02 Jun 2026 09:46:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780393569; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i7W4qyEVTN2loubI3ZwsymrE1lkxoz0iB2gJhLiM6yI=; b=enKTHW+71ZCPIXS2/CGHlm4ocWFSVVO9WAwLsR8Jr/lvNfGKQ8YY81N7MerGQawPBLR4Oi xkTHdv9fmTdees/hFv8M8uJQ04si4Vhsicr5FayhNRa4GzGJtkLKvgD0mFmTXK8q85Lz7o ICBVv/odAWycKbuBLyyHE2RYdVwLaF4iGtOCQgyEzF2Um7nIZlNyHZhAs3czgfZnJg2T/1 RXb1TxiW/NJ+YjhO3+Nbc3KtwOxujBMVfeZRRtlpbOaXTR+cYGj41MTslJDz9OoJHhaV1H pIfoqqskWwjqBJSq/aNwmbvo5ckUsWpxWuOowwMyvsfdpfTfdusm7q8qVtMMfw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780393569; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i7W4qyEVTN2loubI3ZwsymrE1lkxoz0iB2gJhLiM6yI=; b=JH6Vd2+OS943dlgyjDTnHC/j5PAa8iFucwkDbbYcCIQt7ObKvlsNMlpZU6bvjWKta9hV57 sGzJ7/X0eiOHGAAw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/ptp] timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id() Cc: Thomas Gleixner , Arthur Kiyanovski , David Woodhouse , thomas.weissschuh@linutronix.de, Jacob Keller , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260529195557.380601005@kernel.org> References: <20260529195557.380601005@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178039356835.2140988.5609655172387426424.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/ptp branch of tip: Commit-ID: a19658b83784d305ceed5bee3fdf5fdb955a5d1a Gitweb: https://git.kernel.org/tip/a19658b83784d305ceed5bee3fdf5fdb9= 55a5d1a Author: Thomas Gleixner AuthorDate: Fri, 29 May 2026 22:00:24 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 02 Jun 2026 11:39:58 +02:00 timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id() Now that all users are converted it's possible to enable snapshotting of CLOCK_AUX time. The underlying clocksource is the same as for all other CLOCK variants. Signed-off-by: Thomas Gleixner Tested-by: Arthur Kiyanovski Reviewed-by: David Woodhouse Reviewed-by: Thomas Wei=C3=9Fschuh Reviewed-by: Jacob Keller Link: https://patch.msgid.link/20260529195557.380601005@kernel.org --- kernel/time/timekeeping.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index a134b1b..e43aa11 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -67,6 +67,7 @@ static inline bool tk_is_aux(const struct timekeeper *tk) { return tk->id >=3D TIMEKEEPER_AUX_FIRST && tk->id <=3D TIMEKEEPER_AUX_LAS= T; } +static inline struct tk_data *aux_get_tk_data(clockid_t id); #else static inline bool tk_get_aux_ts64(unsigned int tkid, struct timespec64 *t= s) { @@ -77,6 +78,10 @@ static inline bool tk_is_aux(const struct timekeeper *tk) { return false; } +static inline struct tk_data *aux_get_tk_data(clockid_t id) +{ + return NULL; +} #endif =20 static inline void tk_update_aux_offs(struct timekeeper *tk, ktime_t offs) @@ -1218,6 +1223,12 @@ void ktime_get_snapshot_id(clockid_t clock_id, struc= t system_time_snapshot *syst tkd =3D &tk_core; offs =3D &tk_core.timekeeper.offs_boot; break; + case CLOCK_AUX ... CLOCK_AUX_LAST: + tkd =3D aux_get_tk_data(clock_id); + if (!tkd) + return; + offs =3D &tkd->timekeeper.offs_aux; + break; default: WARN_ON_ONCE(1); return; @@ -1228,6 +1239,10 @@ void ktime_get_snapshot_id(clockid_t clock_id, struc= t system_time_snapshot *syst do { seq =3D read_seqcount_begin(&tkd->seq); =20 + /* Aux clocks can be invalid */ + if (!tk->clock_valid) + return; + now =3D tk_clock_read(&tk->tkr_mono); systime_snapshot->cs_id =3D tk->tkr_mono.clock->id; systime_snapshot->cs_was_changed_seq =3D tk->cs_was_changed_seq;