From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.19 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796202521; b=GzjbWNpMCGn+geHSxmKJzPmiAclgMWKPou3WpZHddqNGliP8iPi5V1cOVZaqLhHWI5Cc V8inzaJIkFC5lqT8eMhyQNB6jlW451soOVzsoDisq68qP/XF1Ih7iKA5KQmxbiKkLGwx4 UgXQ01C1jOGsn6yLHYPMFVjj7oF8gDlxnPrlFchfiISiX6HqvONWlmI4+aPJVbNI2keuN S9gVNnRehBZNBpxYcAB6FNGyEhjkA2ggwflBaMAMlDVvGUs25sqjmmYTxd57QYskH2JzO BPPlZu5mANAM1dA9bNdcUxYUOLCWsCrihyPZWyrjW4bOLigIYbK5lhP9nelEABzEalg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796202521; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=dxxyeVjI5PoXd06ibaSFYfUAVkx2VXiSkVY9TPkmh9M=; b=Xsxucp/VsLro6Mw2GH8emv6Jk35I+I/4ATR/X5RG5+anvY6hcBWcxQldxF+pug/xkstL XTwTkKZqK5Krjs5kZr29lPhEx89d2GVSosR8tM8GNizOMrdIBRM8LIimCGNiVh/icnW31 SZNbVvzRqi7f/gAKYVxGjof7+4XTNge8+YnENP7zUl+ivSYCfbT5rju71bDmfB+Ui5FC9 xSbe+s8kvrvzFcmbt/cu7vbZaf2wLzLjNEuvr3LndBJX2NRVFQ7CGlIP4onXM7DlDbqFt kBDxNJ+XKEzOTP7BmFBHJm8WQX2wd/Ee1FmLmN/vN+ABPOXctaFI9GIgRZhgxtwllEw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bcsboBNf; arc=none smtp.remote-ip=192.198.163.19 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75D02606A31A; Wed, 2 Dec 2026 09:08:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 75D02606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bcsboBNf DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796202521; x=1827738521; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dxxyeVjI5PoXd06ibaSFYfUAVkx2VXiSkVY9TPkmh9M=; b=bcsboBNftUHQ6nt3RN2LML0WS/9+CSfMCreogWMfNaW4GiKZpck25eR4 pXsfyOBEdvdeNrTs4aHF7kXyWsaUP4RZjTGn76lLLPQk3f5y772Qu0nZE QebErNxhGWnEuiIITh1Yoo0b8s+NZw43uNQN53mfuJngX4B3zpOC66cB8 YjuSxIdf2loMwWXG0C4G8y0zWBCOXUz0WX51GWT7x/HhxPngfhl8Fbn2H XBL8ylXu9y6M9HSzCB2tAMyA1Bw/M8X/g+fHnuBUEmgADt/J+05aHdRLZ M0UhU/EGWDXlodsBHdgXuXK8SCewMOwuHdEitEZDuvosi1vM+VKfiPCRL A==; X-CSE-ConnectionGUID: GgOuZobwQYmdsJJDGZXLSQ== X-CSE-MsgGUID: nWD3nWu+TxaAwfs7Zn+itg== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5133592" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5133592" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 01:08:40 -0800 X-CSE-ConnectionGUID: LOPkuP5/Quu64f/nojvMYw== X-CSE-MsgGUID: QaqckMNeTJ+wLCXno5AfNQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13989177" Received: from faizal-nuc12wski7.png.intel.com ([10.107.255.69]) by fmviesa001.fm.intel.com with ESMTP; 02 Dec 2026 01:08:37 -0800 From: KhaiWenTan To: Rodolfo Giometti , Greg Kroah-Hartman , Jonathan Corbet Cc: Thomas Gleixner , Andy Shevchenko , david.zage@intel.com, weifeng.voon@intel.com, hong.aun.looi@intel.com, christopher.s.hall@intel.com, khai.wen.tan@intel.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 0/4] pps: add Intel Timed I/O PPS input support Date: Thu, 3 Dec 2026 01:21:54 +0800 Message-ID: <20261202172254.1188109-1-khai.wen.tan@linux.intel.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@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 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