From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796048681; b=IU5TJ638b+OrP3XE5oW97f6VxvhZ6XeAdyRXTafjT/FOUtj1IQ2jdOCQtY9b6U6BUkL0 7J46+cQdZ1cOWpVPAeoHy/MEjKfhIDsRdvJGuLYlKPWMQrGPQ6HgQyia/jm/DzoSlg5LH qAPoUt5GxmlYCrw5bCtSKQzE0XlpI/Ye/J3FyV6VzDuVVqjRVVM8mXYQJsUvitrsT1B9R KXkwmtQGdw1CmVAsCgxwqOVM0yOhUZuPleFEqI9aMiBXASwRmAC9wn1FFD4NUxUnELceZ OK8WNb/HpMRDETBujGhsQDQhCTw12AmbddLectR9Han7RLeLAT45HA+4GrNxrTgGh7w== 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=K3HgPvBtXnMA98KgrLd1FSWGMgHjNWYoiwnZl/g1F/0Oey4fx8BS0fPESCdYs34Je1yJ P0Fxyqms7dF2dvwEcdTkxL4A58fqvrDGNsRx8RSQKKB25PRvVPxBRuTIqDaDVaD3uBZ6B gzVMu78lQJtQHM7U3zzWb8G5X4iGZSS5JwFLFDOeSntioB6YmotzBstB99ftLl9GIbr6n DVY5SBQ+DUEI99U3/lC+6hUg3X3RIXsXdDhKQWt777/MFV2xJLl0VB19y51laU2PyohqE FQ5HmL5nDH67ZqeztGlMh+FnojpX3+ivm2F/ni2DcOr0rwvfNa8uqJTKVqsdiLKOzvQ== 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=C396Rhr2; arc=none smtp.remote-ip=209.85.221.51 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 1B1F4606A329 for ; Mon, 30 Nov 2026 14:24:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1B1F4606A329 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=C396Rhr2 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4a42b34e930so9344055f8f.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=vger.kernel.org; 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=C396Rhr2BkQe6RVrTkQSVPz0dT9o1YKJMDZctOJizvNwS/WoL/HYImnGzWiUfAzIxM SK6mn4hXJHtmgKJISzEHAy3zZrUi1kxRSM7TdCLLD52OVFs/syA+nMJtH1a3CkSAsbgw srkj9qut0JZ+XuMX+c1mWJciHnw+OdjUYp3jW94He1eDvXvHKPkubeneUqsGch+t8ZS/ 1Oj4lD4+fSyCgdw8AAW0dapAHhJXLgbszbG7alQKXR8D0ibpW2OASCb/j5d3i0AY2hF8 dwNKzOx7BTE/bAnpjoQwHaiVbF1f5yDCi8G9r1UDEx4qPHJ6NcLbft6b3ijWocB2NEhn w6Nw== 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=YcOZRyNn77pT+sfqZUushr+8GT/G5GMNaDWT1IEQYqC58p5mmjmXZXlhUIEr0vRLca gr+sGgvU4YYnMg9StWGH3Vzw7m2CSCcMbvmAAhb7Qj/4qzCLKp2F8Ee36mUdYpFLpL8L GTu/yAEV5NW3uRZAcszkjB36rW4gfy246mRMsgf2PkuRi494iJ6+rpKLqzJjdIiZ3QV0 R+QsFIX/nJkf14VwsxpyOrB64wFbRgiiWI95ZBlmr8lTV4J12GhIJFSByovXKdNAFRqU XOy4FmhoQH4kHkPySCrZ+AOpcjfM0L4ojEqUFPPr5kRAyLy8fiL+0WEGwNiXkdlIayGe xW/Q== X-Forwarded-Encrypted: i=1; AL+hErELFgGC0sl/HOuDZ0NxsjfE//fRBX8eDe/0dYW+CI8HxX+9E5mZYRU4qLEiqpa7Kqnhy+uHg4nreWza@vger.kernel.org X-Gm-Message-State: APuU4Z/OG3aBYCtfKTcLguAAn5eylGXRpXTzWqm5K40ZrnfaSQ1ukbgR edReOJR692RakLFVzUT3VwapXD97s38Da/nVGkKX++uIZxSvd5Cne3zZ X-Gm-Gg: AZFdTZd/aJWhAbW51sUB0yFwQdVm1Lu5dAXr6HHqNz4UXYzRmfji5vjLePL8F+995HQ j4ubp9gb2asNbqoTtQJPHNQIA86TB/GXlmuUayzFdD+mGpD9qUibt8erukX07iG+zofbkSbmJct vsOhMN0fE9KOXxkmDHtCN/M4fB4+EQ9nuRY1ZyscdZWfecWYpcR7NyP+rDeypLF2PKd3tPxx1DV C4asJzitHgWQbSR+i64lmllANbzbsvXRBMsL4lhiMDysFMcVft2H9L5wQt7gxmJ4PVCI/UsIdwV LR854+DL6NRRNOkulBPlqbVJZELKL5MltCaGCRrGQYUY/3TfMidZB1mnwd/XZVvk0tac5OFSXPM IA/JDO7Al+NEOMXEGOjC0111PrGPpcQqIs8xzp5cO8vTcvk8NOyrl+LJgMnasgC/N//vouetEAH 0haEojQCx9QR2W6dv2yHDxDn+y3N0fLPYWEWX9A5EEb7O8lXkNdnQPEoQ6NcjDTriJBSDfzVZOH JTmTzU4D/hiR+shIQMQBQpnSEVSwfsMQ/2puY0/SLXwl3/l/Nf6Sllf9PqaOxsIZpYEASiEcfg0 X8Lj5wFEhEeaSwAYY/cIoa/8Qyv+f99h1M3yy7SX3Q== 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: linux-gpio@vger.kernel.org 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