From: Eli Gavril <eli.gavril@gmail.com>
To: Dipen Patel <dipenp@nvidia.com>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>
Cc: Kent Gibson <warthog618@gmail.com>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
timestamp@lists.linux.dev, linux-gpio@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org,
linux-api@vger.kernel.org
Subject: [PATCH 0/3] hte, gpio: HTE timestamps in CLOCK_REALTIME on NVIDIA Tegra
Date: Mon, 30 Nov 2026 16:24:32 +0200 [thread overview]
Message-ID: <20261130142435.1292201-1-eli.gavril@gmail.com> (raw)
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
next reply other threads:[~2026-11-30 14:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 14:24 Eli Gavril [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130142435.1292201-1-eli.gavril@gmail.com \
--to=eli.gavril@gmail.com \
--cc=brgl@kernel.org \
--cc=corbet@lwn.net \
--cc=dipenp@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=linusw@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=thierry.reding@kernel.org \
--cc=timestamp@lists.linux.dev \
--cc=warthog618@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox