From nobody Mon Jun 8 03:19:49 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 7B03C403E84; Thu, 4 Jun 2026 09:07:59 +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=1780564080; cv=none; b=qd3/cyOFuLUh92SDmOozbUXNM/OFPcwFq7frfUNLwHPeqA4UD+kNrt/uwFqh77ZbMz88Tv8VN3v5cl+xh59PHeko2fhmWWbFhiWCfyerBMPTCXSC9mGLzFrIdoUQ8Bo4ueG2JNyslfWJ4iVwU0ds7DXbt6hCaZZBnU8Ihjaujls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780564080; c=relaxed/simple; bh=SWJ8+NOmRih6hyuWsDOrn7Sb+3a6+JziQCQmqaLag1Q=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=BzSw633aKhlg4YQidp8CmgIX7wei1OaD0qTcggt0Ht22IeA/jPNvF1OkXfikIs4PXNrel7B9jpXKK1Wsq0HqoJINDI45MD3Lf433GvYpuaOcCLL7cBei3H05WwZqQkjsx9jP9VaTOykLYldJejFnWR1UsFAC6WrJhh3zEHdKX7A= 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=cfh8GUwi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nXcILpV3; 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="cfh8GUwi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nXcILpV3" Date: Thu, 04 Jun 2026 09:07:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780564078; 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=GZN/RdWtmsksNs5UAzXxIs0uDvp0vXEcf9Jmwkc+8wY=; b=cfh8GUwitNVv02Kl9fwU+3X+upTxRheeYu5lfpZ2X7n7RtAnYXI4D6iPuOrcquzKWi+gA+ ly/VUPo5YPefbX/YDYsLFiioNaPyfrtU3M/TWODje+0J4s8kEO23q9kGkGR0MCgT6rdqp1 EJeVBlO7HDL6qVnevmFh04aocHu/GqC+widoPxuo1M8jFNsp8/0fgS01UzfSO/YLen5Hx7 oJofTGlR8WTLGFtTS3ZJ/lYVZS3/4JDlg0ebiImOdhKeWh1AnftKSeJVvnqJ7odwblU7hB 6qPGS5gf/VUG2ksMbRHyLjpiPtG9FvgvOI2wsAXy6H7Kqb1Ip1Q6MsD9sK24hA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780564078; 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=GZN/RdWtmsksNs5UAzXxIs0uDvp0vXEcf9Jmwkc+8wY=; b=nXcILpV3OcqQbp2ApEnHJNdIsSgWX8qPry5bRXk5X1wrhH794fhZMEoBX2zkQLtbHrnUtp Ix8jXh3mUZbAjLCw== 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: <178056407671.710.770575418278241717.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: 23c1bfa9f8dbefe0be1fa32aaf235c08cb24bd78 Gitweb: https://git.kernel.org/tip/23c1bfa9f8dbefe0be1fa32aaf235c08c= b24bd78 Author: Thomas Gleixner AuthorDate: Fri, 29 May 2026 22:00:24 +02:00 Committer: Thomas Gleixner CommitterDate: Thu, 04 Jun 2026 11:04:16 +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;