* Re: [PATCH 20/24] wifi: iwlwifi: Use system_device_crosststamp::sys_systime
From: David Woodhouse @ 2026-05-26 23:55 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171224.198945692@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
On Tue, 26 May 2026 19:15:07 +0200, Thomas Gleixner wrote:
> sys_systime is an alias for sys_realtime. The latter will be removed so
> switch the code over to the new naming scheme.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 19/24] ptp: Use system_device_crosststamp::sys_systime
From: David Woodhouse @ 2026-05-26 23:54 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171224.124442963@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
On Tue, 26 May 2026 19:15:02 +0200, Thomas Gleixner wrote:
> .. to prepare for cross timestamps with variable clock IDs.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 18/24] timekeeping: Prepare for cross timestamps on arbitrary clock IDs
From: David Woodhouse @ 2026-05-26 23:54 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171224.050496338@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 945 bytes --]
On Tue, 26 May 2026 19:14:57 +0200, Thomas Gleixner wrote:
> PTP device system crosstime stamps support only CLOCK_REALTIME, which is
> meaningless for AUX clocks. The PTP core hands in the clock ID already, so
> prepare the core code to honor it.
>
> - Add a new sys_systime field to struct system_device_crosststamp which
> aliases the sys_realtime field. Once all users are converted
> sys_realtime can be removed.
>
> - Prepare get_device_system_crosststamp() and the related code for it by
> switching to sys_systime and providing the initial changes to utilize
> different time keepers.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
I suspect I'll be back to frown at adjust_historical_crosststamp() at
some point, but that's a separate issue. For this change:
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 17/24] timekeeping: Remove ktime_get_snapshot()
From: David Woodhouse @ 2026-05-26 23:52 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.974925389@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
On Tue, 26 May 2026 19:14:52 +0200, Thomas Gleixner wrote:
> All users have been converted to ktime_get_snapshot_id().
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 16/24] virtio_rtc: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:51 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.901103717@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
On Tue, 26 May 2026 19:14:47 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Use ktime_get_snapshot_id() and hand the provided clock ID in.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 15/24] net/mlx5: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:51 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.826096151@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
On Tue, 26 May 2026 19:14:42 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Use ktime_get_snapshot_id() and hand the provided clock ID in.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 14/24] igc: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:50 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.745281238@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
On Tue, 26 May 2026 19:14:37 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in igc_phc_get_syncdevicetime() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 13/24] ice/ptp: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:49 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.670955218@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 505 bytes --]
On Tue, 26 May 2026 19:14:33 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which then system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in ice_capture_crosststamp() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 12/24] wifi: iwlwifi: Adopt PTP cross timestamps to core changes
From: David Woodhouse @ 2026-05-26 23:47 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.596169122@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
On Tue, 26 May 2026 19:14:28 +0200, Thomas Gleixner wrote:
> iwlwifi only supports CLOCK_REALTIME timestamps and provides an incomplete
> result without system counter values etc.
>
> It also zeros struct system_device_crosststamp, which is already zeroed in
> the core and initialized with the clock ID.
>
> Remove the zeroing and reject any request for a clock ID other than REALTIME.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 11/24] timekeeping: Add CLOCK ID to system_device_crosststamp
From: David Woodhouse @ 2026-05-26 23:46 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.522578743@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
On Tue, 26 May 2026 19:14:23 +0200, Thomas Gleixner wrote:
> The normal capture for system/device cross timestamps is CLOCK_REALTIME,
> but that's meaningless for AUX clocks.
>
> Add a clock_id field to struct system_device_crosststamp and initialize it
> with CLOCK_REALTIME at the two places which prepare for cross
> timestamps.
>
> After the related code has been cleaned up, the core code will honor the
> clock_id field when calculating the system time from the system counter
> snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 10/24] timekeeping: Add system_counterval_t to struct system_device_crosststamp
From: David Woodhouse @ 2026-05-26 23:45 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.448889379@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
On Tue, 26 May 2026 19:14:18 +0200, Thomas Gleixner wrote:
> An upcoming extension to the PTP IOCTL requires to return the system counter
> value and the clocksource ID to user space. get_device_system_crosststamp() has
> this information already.
>
> Extend struct system_device_crosststamp with a system_counterval_t member
> and fill in the data.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 9/24] timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:44 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.374814973@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 339 bytes --]
On Tue, 26 May 2026 19:14:13 +0200, Thomas Gleixner wrote:
> 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 <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 8/24] timekeeping: Remove system_time_snapshot::real/boot
From: David Woodhouse @ 2026-05-26 23:44 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.300914258@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
On Tue, 26 May 2026 19:14:08 +0200, Thomas Gleixner wrote:
> All users are converted over to ktime_get_snapshot_id() and
> system_time_snapshot::sys.
>
> Remove the leftovers.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 7/24] ptp: ptp_vmclock: Convert to ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:43 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.223860692@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
On Tue, 26 May 2026 19:14:03 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
> request a particular CLOCK ID to be captured along with the clocksource
> counter.
>
> Convert vmclock over and use the new system_time_snapshot::sys field, which
> holds the system timestamp selected by the CLOCK ID argument.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 6/24] KVM: arm64: Use ktime_get_snapshot_id() to snapshot CLOCK_REALTIME
From: David Woodhouse @ 2026-05-26 23:43 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.144327185@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 546 bytes --]
On Tue, 26 May 2026 19:13:58 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
> request a particular CLOCK ID to be captured along with the clocksource
> counter.
>
> Convert the usage in kvm_get_ptp_time() over and use the new
> system_time_snapshot::sys field, which holds the system timestamp selected
> by the CLOCK ID argument.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 5/24] KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME
From: David Woodhouse @ 2026-05-26 23:42 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.070087856@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
On Tue, 26 May 2026 19:13:53 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
> request a particular CLOCK ID to be captured along with the clocksource
> counter.
>
> Convert the tracing mechanism over and use the new
> system_time_snapshot::sys field, which holds the system timestamp selected
> by the CLOCK ID argument.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 4/24] pps: Convert to ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:42 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.995833811@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
On Tue, 26 May 2026 19:13:48 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() resolves to ktime_get_snapshot_id(CLOCK_REALTIME).
>
> Make it obvious in the code and convert the readout to use the
> snapshot::sys field instead of snapshot::real, which is going away.
>
> Similar to the PPS generators, avoid the more expensive snapshot when
> CONFIG_NTP_PPS is disabled.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 3/24] pps: generators: Use ktime_get_real_ts64() instead of ktime_get_snapshot()
From: David Woodhouse @ 2026-05-26 23:42 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.920736414@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
On Tue, 26 May 2026 19:13:43 +0200, Thomas Gleixner wrote:
> There is no reason to use the more complex ktime_get_snapshot() for
> retrieving CLOCK_REALTIME.
>
> Just use ktime_get_real_ts64(), which avoids the extra timespec64
> conversion as a bonus.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 2/24] timekeeping: Use system_time_snapshot::sys instead of ::real
From: David Woodhouse @ 2026-05-26 23:40 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.846848261@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 634 bytes --]
On Tue, 26 May 2026 19:13:38 +0200, Thomas Gleixner wrote:
> system_time_snapshot::sys provides the same information as
> system_time_snapshot::real when the snapshot was taken with
> ktime_get_snapshot_id(CLOCK_REALTIME).
>
> Convert the history interpolation over to use 'sys' as 'real' is going away
> once all users are converted.
>
> As a side effect this is the first step to support CLOCK_AUX with
> get_device_crosstime_stamp() and the history interpolation.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [patch 01/24] timekeeping: Provide ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:39 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.769770418@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]
On Tue, 26 May 2026 19:13:33 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() provides a snapshot of the underlying clocksource
> counter value and the corresponding CLOCK_MONOTONIC_RAW, CLOCK_REALTIME and
> CLOCK_BOOTTIME timestamps.
>
> There is no usage of CLOCK_REALTIME and CLOCK_BOOTTIME at the same time and
> CLOCK_BOOTTIME support was just added for the ARM64 KVM tracing mechanism,
> which needs CLOCK_BOOTTIME and the underlying clocksource counter value.
>
> ktime_get_snapshot() is also not suitable for usage with CLOCK_AUX, but
> that's a prerequisite to support PTP hardware timestamping for CLOCK_AUX
> steering.
>
> As a first step, rename ktime_get_snapshot() to ktime_get_snapshot_id(),
> which now takes a clockid argument to select the clock which needs to be
> captured. The result is stored in system_time_snapshot::sys, which will
> replace the system_time_snapshot::real/boot members once all usage sites
> have been converted.
>
> ktime_get_snapshot() is a simple wrapper which hands in CLOCK_REALTIME as
> clockid argument for the conversion period. That means CLOCK_REALTIME is
> now captured twice, but that redunancy is only temporary.
>
> No functional change vs. current users of ktime_get_snapshot()
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [patch 00/24] timekeeping/ptp: Expand snapshot functionality
From: Jacob Keller @ 2026-05-26 21:56 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <20260526165826.392227559@kernel.org>
On 5/26/2026 10:13 AM, Thomas Gleixner wrote:
> Sorry for the large CC list, but changing the inner workings touches
> unfortunately a lot of places in one go.
>
> PTP wants to grow new snapshot functionality, which provides not only the
> captured CLOCK* values, but also the underlying clocksource counter value.
>
> https://lore.kernel.org/20260515164033.6403-1-akiyano@amazon.com
>
> There was quite some discussion in seemingly related threads how to capture
> these values and how to provide core infrastructure so that driver writers
> have something to work with
>
> https://lore.kernel.org/20260514225842.110706-1-hramamurthy@google.com
> https://lore.kernel.org/20260520135207.37826-1-dwmw2@infradead.org
>
> This series implements the timekeeping related mechanisms to:
>
> 1) Capture CLOCK values along with the clocksource counter value for
> non-hardware based sampling
>
> 2) Expanding the hardware cross time stamp mechanism to hand back the
> clocksource counter value, which was captured by the device, along
> with the related CLOCK values
>
> 3) Adding AUX clock support to the hardware cross timestamping core
>
Overall the series looks good to me. I made some comments while
reviewing but nothing major and I think mostly it was on interim code
that is removed by the end of the series.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> It's based on v7.1-rc2 and also available from git:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git timekeeping-ptp-extend-v1
>
> Thanks to David for rebasing his PTP/timekeeping work on top and providing
> feedback, fixes and testing.
>
> Thanks,
>
> tglx
> ---
> arch/arm64/kvm/hyp_trace.c | 8
> arch/arm64/kvm/hypercalls.c | 6
> drivers/net/dsa/sja1105/sja1105_main.c | 8
> drivers/net/ethernet/intel/ice/ice_ptp.c | 5
> drivers/net/ethernet/intel/igc/igc.h | 1
> drivers/net/ethernet/intel/igc/igc_ptp.c | 4
> drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 4
> drivers/net/wireless/intel/iwlwifi/mld/ptp.c | 5
> drivers/net/wireless/intel/iwlwifi/mvm/ptp.c | 7
> drivers/pps/generators/pps_gen-dummy.c | 6
> drivers/pps/generators/pps_gen_tio.c | 6
> drivers/ptp/ptp_chardev.c | 18 +
> drivers/ptp/ptp_ocp.c | 11 -
> drivers/ptp/ptp_vmclock.c | 25 --
> drivers/virtio/virtio_rtc_ptp.c | 2
> include/linux/pps_kernel.h | 8
> include/linux/ptp_clock_kernel.h | 15 -
> include/linux/timekeeping.h | 54 ++---
> kernel/time/timekeeping.c | 211 ++++++++++++--------
> sound/hda/common/controller.c | 4
> 20 files changed, 236 insertions(+), 172 deletions(-)
^ permalink raw reply
* Re: [patch 14/24] igc: Use provided clock ID for history snapshot
From: Jacob Keller @ 2026-05-26 21:51 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Tony Nguyen, Rodolfo Giometti,
Vincent Donnefort, Marc Zyngier, Oliver Upton, kvmarm,
Oliver Upton, Richard Cochran, netdev, Takashi Iwai,
Miri Korenblit, Johannes Berg, Saeed Mahameed, Peter Hilber,
Michael S. Tsirkin, virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171223.745281238@kernel.org>
On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in igc_phc_get_syncdevicetime() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
^ permalink raw reply
* Re: [patch 13/24] ice/ptp: Use provided clock ID for history snapshot
From: Jacob Keller @ 2026-05-26 21:51 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <20260526171223.670955218@kernel.org>
On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which then system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in ice_capture_crosststamp() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> Cc: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
^ permalink raw reply
* Re: [patch 08/24] timekeeping: Remove system_time_snapshot::real/boot
From: Jacob Keller @ 2026-05-26 21:52 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <9819b5ee-1f03-4687-9a36-9284741e19a4@intel.com>
On 5/26/2026 2:49 PM, Jacob Keller wrote:
> On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
>> All users are converted over to ktime_get_snapshot_id() and
>> system_time_snapshot::sys.
>>
>
> I would have expected this to also remove ktime_get_snapshot() since the
> description claims all users are converted to ktime_get_snapshot_id().
>
Ah. All the users of the real/boot paramaters have been updated, but
drivers still use ktime_get_snapshot() until later in the series. Ok,
that makes sense.
^ permalink raw reply
* Re: [patch 08/24] timekeeping: Remove system_time_snapshot::real/boot
From: Jacob Keller @ 2026-05-26 21:49 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <20260526171223.300914258@kernel.org>
On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
> All users are converted over to ktime_get_snapshot_id() and
> system_time_snapshot::sys.
>
I would have expected this to also remove ktime_get_snapshot() since the
description claims all users are converted to ktime_get_snapshot_id().
> Remove the leftovers.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> ---
> include/linux/timekeeping.h | 4 ----
> kernel/time/timekeeping.c | 8 --------
> 2 files changed, 12 deletions(-)
>
> --- a/include/linux/timekeeping.h
> +++ b/include/linux/timekeeping.h
> @@ -280,8 +280,6 @@ static inline bool ktime_get_aux_ts64(cl
> * a selected CLOCK_* and the clocksource counter value
> * @cycles: Clocksource counter value to produce the system times
> * @sys: The system time of the selected CLOCK ID
> - * @real: Realtime system time
> - * @boot: Boot time
> * @raw: Monotonic raw system time
> * @cs_id: Clocksource ID
> * @clock_was_set_seq: The sequence number of clock-was-set events
> @@ -291,8 +289,6 @@ static inline bool ktime_get_aux_ts64(cl
> struct system_time_snapshot {
> u64 cycles;
> ktime_t sys;
> - ktime_t real;
> - ktime_t boot;
> ktime_t raw;
> enum clocksource_ids cs_id;
> unsigned int clock_was_set_seq;
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -1196,8 +1196,6 @@ bool ktime_get_snapshot_id(struct system
> struct timekeeper *tk;
> struct tk_data *tkd;
> unsigned int seq;
> - ktime_t base_real;
> - ktime_t base_boot;
>
> /* Invalidate the snapshot for all failure cases */
> systime_snapshot->valid = false;
> @@ -1239,18 +1237,12 @@ bool ktime_get_snapshot_id(struct system
> offs_sys = *offs;
> base_raw = tk->tkr_raw.base;
>
> - /* Kept around until the callers are fixed up */
> - base_real = ktime_add(base_sys, tk_core.timekeeper.offs_real);
> - base_boot = ktime_add(base_sys, tk_core.timekeeper.offs_boot);
> -
> nsec_sys = timekeeping_cycles_to_ns(&tk->tkr_mono, now);
> nsec_raw = timekeeping_cycles_to_ns(&tk->tkr_raw, now);
> } while (read_seqcount_retry(&tkd->seq, seq));
>
> systime_snapshot->cycles = now;
> systime_snapshot->sys = ktime_add_ns(base_sys, offs_sys + nsec_sys);
> - systime_snapshot->real = ktime_add_ns(base_real, nsec_sys);
> - systime_snapshot->boot = ktime_add_ns(base_boot, nsec_sys);
> systime_snapshot->raw = ktime_add_ns(base_raw, nsec_raw);
>
> /*
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox