Linux HTE (hardware timestamp engine) subsytem
 help / color / mirror / Atom feed
* [PATCH 0/3] hte, gpio: HTE timestamps in CLOCK_REALTIME on NVIDIA Tegra
@ 2026-11-30 14:24 Eli Gavril
  2026-11-30 14:24 ` [PATCH 1/3] hte: add CLOCK_REALTIME-correlated timestamp to hte_ts_data Eli Gavril
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eli Gavril @ 2026-11-30 14:24 UTC (permalink / raw)
  To: Dipen Patel, Linus Walleij, Bartosz Golaszewski
  Cc: Kent Gibson, Thierry Reding, Jonathan Hunter, Jonathan Corbet,
	Shuah Khan, Randy Dunlap, timestamp, linux-gpio, linux-tegra,
	linux-doc, linux-api

HTE supports the NVIDIA Tegra Generic Timestamping Engine (GTE), but
only in the GTE's own counter time, not in CLOCK_REALTIME, so it cannot
be used as is to timestamp a GNSS PPS. NVIDIA instead uses its
out-of-tree nvpps driver [1], which reads the GTE through HTE but
reports through its own character device rather than the GPIO API. This
series adds CLOCK_REALTIME timestamps to HTE and the GPIO API.

Patch 1 adds a CLOCK_REALTIME-correlated time to struct hte_ts_data,
patch 2 fills it in the Tegra194 GTE driver, and patch 3 returns it when
user space requests HTE and REALTIME together, which is rejected today.
If a separate flag is preferred over combining the two, I can change it.

Tested on a Jetson Orin NX with a 1 Hz PPS for one hour, on 6.18 with
this series and eba302268a01 ("timekeeping: Provide
ktime_get_snapshot_id()"): no pulse was missed, and consecutive
intervals differed by at most one 32 ns GTE tick in 91% of cases and by
at most 96 ns overall. HTE alone, REALTIME alone and no clock flag
behave as before, both there and with gpio-sim in QEMU.

The series was developed with an LLM coding assistant (Claude Code,
model Claude Opus 5.5), which drafted the code and messages; I reviewed
and tested all of it.

[1] https://gitlab.com/nvidia/nv-tegra/linux-nv-oot/-/tree/jetson_39.2.2_GA/drivers/nvpps

Eli Gavril (3):
  hte: add CLOCK_REALTIME-correlated timestamp to hte_ts_data
  hte: tegra194: correlate captured timestamps to CLOCK_REALTIME
  gpiolib: cdev: report HTE timestamps in the CLOCK_REALTIME domain

 .../gpio/gpio-v2-get-line-ioctl.rst           |  3 ++-
 drivers/gpio/gpiolib-cdev.c                   | 21 ++++++++-----------
 drivers/hte/hte-tegra194.c                    | 12 ++++++++++-
 include/linux/hte.h                           |  3 +++
 include/uapi/linux/gpio.h                     |  4 +++-
 5 files changed, 28 insertions(+), 15 deletions(-)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-30 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 14:24 [PATCH 0/3] hte, gpio: HTE timestamps in CLOCK_REALTIME on NVIDIA Tegra Eli Gavril
2026-11-30 14:24 ` [PATCH 1/3] hte: add CLOCK_REALTIME-correlated timestamp to hte_ts_data Eli Gavril
2026-11-30 14:24 ` [PATCH 2/3] hte: tegra194: correlate captured timestamps to CLOCK_REALTIME Eli Gavril
2026-11-30 14:24 ` [PATCH 3/3] gpiolib: cdev: report HTE timestamps in the CLOCK_REALTIME domain Eli Gavril

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox