Re: [PATCH 0/4] pps: add Intel Timed I/O PPS input support

From: Andy Shevchenko

Date: Thu Dec 03 2026 - 06:14:21 EST


On Thu, Dec 03, 2026 at 01:21:54AM +0800, KhaiWenTan wrote:
> 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.

We need some synchronisation between teems internally, please hold on on
this series.

--
With Best Regards,
Andy Shevchenko