From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 9B4D63A873D; Fri, 26 Jun 2026 10:49:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782470985; cv=none; b=uUKvjO7bHiE2BUNatBnrTC4NlCE5qU6GQNaWS+pUFZpLIXzdpOdCbK8K4lvnA6f5QLqzv8M4isBIHkje6Y3bp84EycVno3CXAhv+zOT2nq8AYoJwgYZsu2xrvU/3/7aEPpz8hGqdHaNZI77TpNpioXzQNvGhiTew6L4yMf4c/vA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782470985; c=relaxed/simple; bh=TKcaVW7HVikmiiDGuBeis2gKg/FfUDfyELepoLCpCK8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=UGGpYR9vKIFI2sPjL5gjmPDk0mYo6QcFF/Swj51EeQYYDtzpCBvV1AvTrBM280/pKfbZ/J/lbrpFmJS7MDQ5nFx4f5Y0qQay1rDqum01HDO99/RWyHfIaaLmFPRaQSC9fdzBtXqaPXbL6FCRgOpkZgdr2BeE2dHiMCJQg81pHlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S/5AXIbd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S/5AXIbd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E1151F000E9; Fri, 26 Jun 2026 10:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782470984; bh=tnerpNhOrBLh7vhCHDu/AZ606iUJiugWohBIxX532Qs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=S/5AXIbdXtITWNkQPORvCiw4nseJOJtxhQBffsgTYXrnNrXQot4NqaZnEidHnYNd8 jSr0fAmPPtspqyXLi/XeAb3l+yTF6DTc9w2DGHmPOJgYxldJkDuFQvJBx5N3G+u/C9 7rSuDJYFBjclqydxHAfAYlbx7D1s17+03dXk4rtLGEcULg0GaQIX0WJBDganqI0Ujp r4Nk4fuBeVmRItg41bBL2nwjFWJc867+lzTnbTwexIguKmAUUyyf4w3yamxTZwBuyd mW4hzNVP+BO+ImKm0S1YRC+jYeVE3o2BLpnVuqmMpDHZSy12fCOpdOVrPwhkym65I7 l0h0PrS7XzFyw== From: Thomas Gleixner To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Cc: LKML , David Woodhouse , Miroslav Lichvar , John Stultz , Stephen Boyd , Anna-Maria Behnsen , Frederic Weisbecker , Arthur Kiyanovski , Rodolfo Giometti , Vincent Donnefort , Marc Zyngier , Oliver Upton , kvmarm@lists.linux.dev, Oliver Upton , Richard Cochran , netdev@vger.kernel.org, Takashi Iwai , Miri Korenblit , Johannes Berg , Jacob Keller , Tony Nguyen , Saeed Mahameed , Peter Hilber , "Michael S. Tsirkin" , virtualization@lists.linux.dev, linux-wireless@vger.kernel.org, linux-sound@vger.kernel.org Subject: Re: [patch 09/24] timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id() In-Reply-To: <20260626103359-66ab2b54-d36f-416b-94a4-3f3708dccced@linutronix.de> References: <20260526165826.392227559@kernel.org> <20260526171223.374814973@kernel.org> <20260626103359-66ab2b54-d36f-416b-94a4-3f3708dccced@linutronix.de> Date: Fri, 26 Jun 2026 12:49:41 +0200 Message-ID: <87echtk24a.ffs@fw13> Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Jun 26 2026 at 10:48, Thomas Wei=C3=9Fschuh wrote: > On Tue, May 26, 2026 at 07:14:13PM +0200, Thomas Gleixner wrote: > (...) > >> static inline void tk_update_aux_offs(struct timekeeper *tk, ktime_t of= fs) >> @@ -1218,6 +1223,12 @@ bool ktime_get_snapshot_id(struct system >> 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 false; >> + offs =3D &tkd->timekeeper.offs_aux; >> + break; > > 'tkd' is also used to compute 'monoraw'. However 'tkr_raw' and 'tkr_mono' > are the same for auxilary clocks, so this will compute a wrong 'monoraw'. AUX clocks are independent in the first place and the MONORAW part is the "MONORAW" related to the AUX clock itself.=20 > Instead 'monoraw' should be computed based on 'tk_core'. > Which then also requires the sequence locking of 'tk_core'. No. From a PTP and steering point of view you want the "raw" value which is related to the AUX clock itself and not the global one. The global MONORAW and the AUX clock MONORAW are related obviously as they share the same conversion factors. MONORAW(AUX$N) =3D MONORAW(GLOBAL) + OFFSET(AUX$N) We don't have that information anywhere right now and we might want to expose it to allow user space a proper correlation, but that's an orthogonal problem. >From a PTP/steering point of view the code is correct as is. Thanks, tglx