From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796048681; b=0KclWIR281xoWVJWe/XM91JW6E1swPzYdzfCeQyJPXahYumOb1zHrBLXx0yneXjhi+Ie HFO+UMLRlJpkL0xeDAfaWzofEEzejLBeINFpNyZJloVbJujw+uUYVJPKIcRlg7JbnI9Wz Lg71n1kTYnVETDuvaUG+gBxWFfd4nQeZBKhFa9oXz6EzWn0MmCrIe9Cz2aYoAJbaxBXes oPvqMCnrDZ0t2w+g45w1OVjYV5vzELrTdQJn6PgEHEfGO4OfKzHxHm5DL2uld904AaRmS auBJKNKnr0ixhjsEkKaq/f3buTlItK2gIyI2POR2UJTuWFKju0ONzuh+/SpHziJVo0Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796048681; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=eeYIlvPgUoWVhVgxd6L8TvmDphMOy7gJl1h0U1j4Bfs=; b=FRCix0y61irYV5iyKU6psYk6XSqBsYDY9dxcYa81WfBK7fC4ns+LyW9H6k56zlvl9vd1 Y/5Gk79WylLkA3FtEJHoRhLX+03fdAXFDlqs6dLVXzlZYNEzMmuKuHlJ/xCGqRbIeHyQq nZ6tT/Ja7OTJyetqjkrE0BpmsCU3Th74k99FwE9MoEkXYtCB6fjHTRtbNxEHJDusfD9wZ 9Ww5XRU/OdB9RTVuknl5sEoB0SFT+Wemmi4+P2tTQARMmwWnKcEC2TVEN6HuZUijX4kOe ZMz4rL80vR4uI3JeQi+hJp74xqBGhXBRtqAhGtm9I42iMKeea6ICgi2BxS4K5eEk0lw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uAsJ4tA9; arc=none smtp.remote-ip=209.85.221.52 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F6DA606A325 for ; Mon, 30 Nov 2026 14:24:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0F6DA606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uAsJ4tA9 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-4a42b34e930so9344054f8f.2 for ; Mon, 30 Nov 2026 06:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796048679; x=1796653479; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=eeYIlvPgUoWVhVgxd6L8TvmDphMOy7gJl1h0U1j4Bfs=; b=uAsJ4tA9SNgJ3JYJkDc/Qca6gvepePxBlI8+/9a3BSYVMvEkopvOx9vPx+K0SBiIBC Yl/eyTW98funqkYynAynY9+7tAFeFzDMqvElY4KHLa8G+hfIeYEpdwViyYQnQ+myk53g oFd5KHYcmzoSYJNrdppJIs/7Xu4N0NoEvFVKCz1N/woXvYIiVVC2F2MmlmO6sAl6Xklv 3vMBBzXzBR+Az/XlfzP3PB6LI/uRbmBoINIPdNM6q81QB/w53SK3IdMuisdyMcyBqpPm 2xHavNgUadJqS0zWkIY/59g1R15OmF0brphBHPNxKT8X57eqEi+ymYK32WpJXgcfwxBx 6z8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796048679; x=1796653479; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=eeYIlvPgUoWVhVgxd6L8TvmDphMOy7gJl1h0U1j4Bfs=; b=rXwjU61/m2KwipktNw/X6oO6jtoGm5g/SAc3c3kihcnEwwJhUPBa0Zj96znprcZqhB D+Q97Ht1QDaYzY3tR5d2Z4AH3LCr2EDSeUV3H5St1eBAc80K5MZPMLl3tWwlN8qzGno5 6R0UTmHFCMB1hN5A4LHnNWp4oTxARACgHtPJAqJb5om7IY/jSak+/u3eALd3SI+sA635 tA6HjIJeq6h6TyWEbrXOyG+xJRjaiGY5apxoc3h1gwcz2hbYg3FeJG37lq9wZSmajDEI bT2ZuLRK331tkHxgj1BZvH1GaNc0E+SyEVRaEl+M/y735xI79cd2bdx5NTHwK12P60kc h4vw== X-Forwarded-Encrypted: i=1; AL+hErGYUj2IBxnBmtZSimFyjqfgQlq17u8A/ZQ4b1+9iVJjKRAcKhL4yH3uskWycuKq4KxvvYKmlriB4yU=@lists.linux.dev X-Gm-Message-State: APuU4Z8hiBWkWN8jrFXmKekOvKhpY8pNRqZBeUDH7laZIxt1kUaYR/Dq eYVBsJU9F0z+NNpOhuOW+/rSsQDvgfvK3CCptIWo0cM6SioCLHpkjLxQ X-Gm-Gg: AZFdTZelRyujkqfbDQafk8H6TKyTISue7EJCJnZ9JUMAb6Vi7qHXt6RoEJXRXZrVqtY daX1LYiml3M8tJJh9fg0j83j/vTLr5CbNrE4/XhJha0QYj0L9BDR0AcEDF+zhmA0Ko2HzL/mqEs Cc2sBScOqdkHfA7mi0U4030h50GywdMxQhZyADnrmYx5ElHkkyiwgU2VOz9f/V6FZhEp3Soeztx AooBiZfOuywCZi0vO+O8Gd4/T7ZIZxlNS0DEvxDAaZQRFqGGAfdDatCTl0PIF/GDOzMJ6hOBS8t s5yRgGKpktdAaLtAC4FNaLqKnGBuMzJhB1j0GVEvsW6hiKOoTi+485XMD820z6+H7/YMtQCV/0A 68lnv0htaapBgpJVNIOpvrB/7jlCQXTtJpv0cHgZ3QgIhUpooOwLlpOti/XhLpkcugSuENq8cFO TwtI7uYYRO9WEKz/L2WktQrzM8qio11P/cmpfXfqVMyKzjrKUa1HR6/ETj0vzSsuISvM6XYdvof rQ7jgr7yqP7y6TO+Wkm2TcsNUCUJ9z8N0tsgcXmzGoshHJLi9EUKsna2fxBVNS0Dr7il6hTJKGW OrjRxUbt+5YaOeCpXEwN1+wWd3yGtLs/1y/UgHviPg== X-Received: by 2002:a05:6000:4704:b0:491:6a7:b4ac with SMTP id ffacd0b85a97d-4abb5eabd6bmr66754209f8f.56.1796048679259; Mon, 30 Nov 2026 06:24:39 -0800 (PST) Received: from localhost.localdomain ([104.28.180.169]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6c4353d6sm62407055f8f.56.2026.11.30.06.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 06:24:38 -0800 (PST) From: Eli Gavril To: Dipen Patel , Linus Walleij , Bartosz Golaszewski Cc: Kent Gibson , Thierry Reding , Jonathan Hunter , Jonathan Corbet , Shuah Khan , Randy Dunlap , 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 Message-ID: <20261130142435.1292201-1-eli.gavril@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: timestamp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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