mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] pps: add Intel Timed I/O PPS input support
@ 2026-12-02 17:21 KhaiWenTan
  2026-12-02 17:21 ` [PATCH 1/4] pps: generators: synchronize sysfs and registration failure KhaiWenTan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: KhaiWenTan @ 2026-12-02 17:21 UTC (permalink / raw)
  To: Rodolfo Giometti, Greg Kroah-Hartman, Jonathan Corbet
  Cc: Thomas Gleixner, Andy Shevchenko, david.zage, weifeng.voon,
	hong.aun.looi, christopher.s.hall, khai.wen.tan, linux-kernel,
	linux-doc

Intel Timed I/O (TIO) pins can either generate output edges at a
programmed time or capture input edges, both timestamped in the ART
clock domain. The existing pps_gen_tio driver supports generation only.
This series adds capture support as a PPS client, so an external PPS
signal on a TIO pin can be used as a regular /dev/ppsN source.

Patches 1-2 prepare the existing generator code:

 - Patch 1 serializes the PPS generator sysfs callbacks with source
   removal using the existing info lock, rejects opens and reports a
   hangup after removal, and cleans up when cdev_device_add() fails.

 - Patch 2 moves hrtimer_cancel() in pps_gen_tio out of the spinlocked
   section, since the timer callback takes the same lock, and serializes
   enable, disable and removal with a mutex.

Patch 3 moves ACPI enumeration and register ownership into a new shared
pps_tio platform driver. It creates "generator" and "client" auxiliary
devices, and pps_gen_tio becomes an auxiliary driver. The platform driver
name and the generator's user-visible behavior are unchanged. A new
driver_manages_enabled flag in struct pps_gen_source_info lets the
driver own the enabled state so the generator core cannot overwrite an
asynchronous missed-pulse failure.

Patch 4 adds the pps_tio_client driver. It registers a PPS source per
TIO device, polls the latched timestamp and event counter, converts the
ART timestamp to system time with get_device_system_crosststamp() and
reports the edge as a PPS assert or clear event. Capture is disabled by
default and is controlled per device through two new sysfs attributes,
capture_enable and capture_edge, documented in
Documentation/ABI/testing/sysfs-platform-intel-tio and in
Documentation/driver-api/pps.rst.

Generation and capture are mutually exclusive on a pin. Enabling one
while the other is active fails with -EBUSY. The hardware retains only
the most recent captured edge, so edges arriving between polls are lost;
the driver warns when the event counter shows this has happened.

Voon Weifeng (4):
  pps: generators: synchronize sysfs and registration failure
  pps: generators: cancel TIO timer outside spinlock
  pps: generators: move TIO ownership to auxiliary parent
  pps: clients: add Intel TIO PPS capture

 .../ABI/testing/sysfs-platform-intel-tio      |  24 ++
 Documentation/ABI/testing/sysfs-pps-gen-tio   |   1 +
 Documentation/driver-api/pps.rst              |  29 ++
 MAINTAINERS                                   |   1 +
 drivers/pps/Kconfig                           |   5 +
 drivers/pps/Makefile                          |   1 +
 drivers/pps/clients/Kconfig                   |  10 +
 drivers/pps/clients/Makefile                  |   1 +
 drivers/pps/clients/pps_tio_client.c          | 298 ++++++++++++++++++
 drivers/pps/generators/Kconfig                |   1 +
 drivers/pps/generators/pps_gen.c              |  27 +-
 drivers/pps/generators/pps_gen_tio.c          | 283 +++++++----------
 drivers/pps/generators/sysfs.c                |  27 +-
 drivers/pps/pps_tio.c                         | 167 ++++++++++
 drivers/pps/pps_tio.h                         |  57 ++++
 include/linux/pps_gen_kernel.h                |   2 +
 16 files changed, 757 insertions(+), 177 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-intel-tio
 create mode 100644 drivers/pps/clients/pps_tio_client.c
 create mode 100644 drivers/pps/pps_tio.c
 create mode 100644 drivers/pps/pps_tio.h

-- 
2.43.0


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

end of thread, other threads:[~2026-12-02  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-02 17:21 [PATCH 0/4] pps: add Intel Timed I/O PPS input support KhaiWenTan
2026-12-02 17:21 ` [PATCH 1/4] pps: generators: synchronize sysfs and registration failure KhaiWenTan
2026-12-02 17:21 ` [PATCH 2/4] pps: generators: cancel TIO timer outside spinlock KhaiWenTan
2026-12-02 17:21 ` [PATCH 3/4] pps: generators: move TIO ownership to auxiliary parent KhaiWenTan
2026-12-02 17:21 ` [PATCH 4/4] pps: clients: add Intel TIO PPS capture KhaiWenTan

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

all inboxes | Powered by JetHome®