Intro to Hardware timestamping engine
Subsystems (6)
Dipen Patel
maintainerv2 cover Intro to Hardware timestamping engine
This patch series introduces new subsystem called hardware timestamping engine (HTE). It offers functionality such as timestamping through hardware means in realtime. The HTE subsystem centralizes HTE provider and consumers where providers can register themselves and the consumers can request interested entity which could be lines, GPIO, signals or buses. The HTE subsystem provides timestamp in nano seconds, having said that the provider need to convert the timestamp if its not in that unit. There was upstream discussion about the HTE at
https://lore.kernel.org/lkml/[email protected]/
To summarize upstream discussion:
- It was heavily favoured by Linus and Kent to extend GPIOLIB and supporting GPIO drivers to add HTE functionality and I agreed to experiment with it. This patch series implements and extends GPIOLIB, GPIOLIB-CDEV and GPIO tegra driver.
- Discussed possibility to add HTE provider as irqchip instead which was argued against as HTE devices are not necessarily event emitting devices. This RFC version 2 however tries to emulate threaded irq style implementation.
- Discussed other possibility if HTE device can be added as posix clock type like PTP clocks. That was also argues against since HTE devices are not necessarily tightly coupled with hardware clock.
Typical HTE provider does following:
- Register itself with HTE subsystem
- Provide request, release, enable, disable timestamp and get_clk_src_info callbacks to HTE subsystem.
- Provide optional xlate callback to the subsystem which can translate consumer provided logical ids into actual ids of the entity, where entity here is the provider dependent and could be GPIO, in chip lines or signals, buses etc...This converted id will be used between HTE subsystem and the provider for below bullet point.
- Push timestamps to the subsystem. This happens when HTE provider has timestamp data available and willing to push it to HTE subsystem.
- Unregister itself on exit.
Typical HTE consumer does following:
- Request interested entity it wishes to timestamp in realtime to the subsystem.
- The subsystem does necessary communications with the provider to complete the request, which includes translating logical id of the entity to provider dependent physical/actual id and enabling hardware timestamping on requested id.
- The request includes callbacks, it will be used to push timestamps. Optionally, the consumer can provided threaded callback, if specified, the HTE subsystem will create kernel thread responsible executing the threaded callback.
- Release entity and its resources.
HTE and GPIOLIB:
- For the HTE provider which can timestamp GPIO lines.
- For the GPIO consumers, either in kernel or userspace, The GPIOLIB and its CDEV framework are extended as frontend to the HTE by introducing new APIs.
- Tegra194 AON GPIO controller has HTE support known as GTE (Generic Timestamping Engine). The tegra gpio driver is modified to accommodate HTE functionality.
Changes in V2:
- Removed buffer management and related APIs from the HTE core.
- Removed timestamp retrieve APIs from the HTE core.
- Modified request API with two callbacks, second callback is invoked in thread context and is optional, while first callback is mandatory and used to push timestamp data to consumers.
- Replaced hte with hardware-timestamping in DT bindings as hte appeared too short according to review comments.
Dipen Patel (11):
Documentation: Add HTE subsystem guide
drivers: Add hardware timestamp engine (HTE)
hte: Add tegra194 HTE kernel provider
dt-bindings: Add HTE bindings
hte: Add Tegra194 IRQ HTE test driver
gpiolib: Add HTE support
gpio: tegra186: Add HTE in gpio-tegra186 driver
gpiolib: cdev: Add hardware timestamp clock type
tools: gpio: Add new hardware clock type
hte: Add tegra GPIO HTE test driver
MAINTAINERS: Added HTE Subsystem
.../bindings/gpio/nvidia,tegra186-gpio.txt | 7 + .../hte/hardware-timestamps-common.yaml | 29 + .../devicetree/bindings/hte/hte-consumer.yaml | 48 + .../bindings/hte/nvidia,tegra194-hte.yaml | 79 ++ Documentation/hte/hte.rst | 83 ++ Documentation/hte/index.rst | 22 + Documentation/hte/tegra194-hte.rst | 56 ++ Documentation/index.rst | 1 + MAINTAINERS | 8 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/gpio/gpio-tegra186.c | 89 ++ drivers/gpio/gpiolib-cdev.c | 161 +++- drivers/gpio/gpiolib.c | 73 ++ drivers/gpio/gpiolib.h | 12 + drivers/hte/Kconfig | 50 + drivers/hte/Makefile | 5 + drivers/hte/hte-tegra194-gpio-test.c | 252 +++++ drivers/hte/hte-tegra194-irq-test.c | 169 ++++ drivers/hte/hte-tegra194.c | 554 +++++++++++ drivers/hte/hte.c | 907 ++++++++++++++++++ include/linux/gpio/consumer.h | 19 +- include/linux/gpio/driver.h | 14 + include/linux/hte.h | 248 +++++ include/uapi/linux/gpio.h | 1 + tools/gpio/gpio-event-mon.c | 6 +- 26 files changed, 2884 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml create mode 100644 Documentation/devicetree/bindings/hte/hte-consumer.yaml create mode 100644 Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml create mode 100644 Documentation/hte/hte.rst create mode 100644 Documentation/hte/index.rst create mode 100644 Documentation/hte/tegra194-hte.rst create mode 100644 drivers/hte/Kconfig create mode 100644 drivers/hte/Makefile create mode 100644 drivers/hte/hte-tegra194-gpio-test.c create mode 100644 drivers/hte/hte-tegra194-irq-test.c create mode 100644 drivers/hte/hte-tegra194.c create mode 100644 drivers/hte/hte.c create mode 100644 include/linux/hte.h
base-commit: 2d02a18f75fc81177a4e30f3aaaed9af06cc3adc
Signature · 1 line
2.17.1
Dipen Patel
maintainerRFC v2 1/11 Documentation: Add HTE subsystem guide
Adding hte document which can help understand various APIs implemented in HTE framework for the HTE producers and the consumers.
---
Changes in v2:
- Removed explanation, instead added kernel-doc references.
Documentation/hte/hte.rst | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Documentation/hte/hte.rst
Documentation/hte/hte.rst new file +83 -0
@@ -0,0 +1,83 @@ +============================================ +The Linux Hardware Timestamping Engine (HTE) +============================================ + +:Author: Dipen Patel + +Introduction +------------ + +Certain devices have built in hardware timestamping engines which can +monitor sets of system signals, lines, buses etc... in realtime for state +change; upon detecting the change they can automatically store the timestamp at +the moment of occurrence. Such functionality may help achieve better accuracy +in obtaining timestamp than using software counterparts i.e. ktime and friends. + +This document describes the API that can be used by hardware timestamping +engine provider and consumer drivers that want to use the hardware timestamping +engine (HTE) framework. Both consumers and providers must +#include <linux/hte.h>. + +The HTE framework APIs for the providers +---------------------------------------- + +.. kernel-doc:: drivers/hte/hte.c + :functions: devm_hte_register_chip hte_push_ts_ns + +The HTE framework APIs for the consumers +---------------------------------------- + +.. kernel-doc:: drivers/hte/hte.c + :functions: devm_of_hte_request_ts hte_req_ts_by_hte_name hte_release_ts hte_enable_ts hte_disable_ts hte_get_clk_src_info + +The HTE framework public structures +----------------------------------- +.. kernel-doc:: include/linux/hte.h + + +More on the HTE timestamp data +------------------------------ +The struct hte_ts_data is used to pass timestamp details between the consumers +and the providers. It expresses timestamp data in nano second in u64 data +type. For now all the HTE APIs using struct hte_ts_data requires tsc to be in +nano seconds. An example of the typical hte_ts_data data life cycle, for the +GPIO line is as follows:: + + - Monitors GPIO line change. + - Detects the state change on GPIO line. + - Converts timestamps in nano seconds and stores it in tsc. + - Stores GPIO direction in dir variable if the provider has that hardware + capability. + - Pushes this hte_ts_data object to HTE subsystem. + - HTE subsystem increments seq counter and invokes consumer provided callback. + Based on callback return value, the HTE starts kernel thread and invokes + secondary callback in the thread context. + +HTE subsystem debugfs attributes +-------------------------------- +HTE subsystem creates debugfs attributes at ``/sys/kernel/debug/hte/``. +It also creates line/signal related debugfs attributes at +``/sys/kernel/debug/hte/<provider>/<label or line id>/``. + +`ts_requested` + The total number of entities requested from the given provider, + where entity is the provider specific and could represent + lines, GPIO, chip signals, buses etc... + The attribute will be availble at + ``/sys/kernel/debug/hte/<provider>/``. + + Read only value + +`total_ts` + The total number of entities supported by the provider. + The attribute will be availble at + ``/sys/kernel/debug/hte/<provider>/``. + + Read only value + +`dropped_timestamps` + The dropped timestamps for a given line. + The attribute will be availble at + ``/sys/kernel/debug/hte/<provider>/<label or line id>/``. + + Read only value
Signature · 1 line
2.17.1
Randy Dunlap
reviewerRe: [RFC v2 01/11] Documentation: Add HTE subsystem guide
Quoted 22 lines · Dipen Patel
Adding hte document which can help understand various APIs implemented in HTE framework for the HTE producers and the consumers.
Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- Removed explanation, instead added kernel-doc references.Documentation/hte/hte.rst | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+)create mode 100644
Documentation/hte/hte.rstDocumentation/hte/hte.rst new file +4
-0@@ -0,0 +1,83 @@ +============================================ +The Linux Hardware Timestamping Engine (HTE) +============================================ +
Documentation/hte/hte.rst line 14
Quoted 10 lines
Documentation/hte/hte.rst new file +10
-0+:Author: Dipen Patel + +Introduction +------------ + +Certain devices have built in hardware timestamping engines which can +monitor sets of system signals, lines, buses etc... in realtime for state +change; upon detecting the change they can automatically store the timestamp at +the moment of occurrence. Such functionality may help achieve better accuracy +in obtaining timestamp than using software counterparts i.e. ktime and friends.
timestamps
Quoted 17 lines
Documentation/hte/hte.rst new file +17
-0+ +This document describes the API that can be used by hardware timestamping +engine provider and consumer drivers that want to use the hardware timestamping +engine (HTE) framework. Both consumers and providers must +#include <linux/hte.h>. + +The HTE framework APIs for the providers +---------------------------------------- + +.. kernel-doc:: drivers/hte/hte.c + :functions: devm_hte_register_chip hte_push_ts_ns + +The HTE framework APIs for the consumers +---------------------------------------- + +.. kernel-doc:: drivers/hte/hte.c + :functions: devm_of_hte_request_ts hte_req_ts_by_hte_name hte_release_ts hte_enable_ts hte_disable_ts hte_get_clk_src_info
Documentation/hte/hte.rst line 41
Quoted 10 lines
Documentation/hte/hte.rst new file +10
-0+ +The HTE framework public structures +----------------------------------- +.. kernel-doc:: include/linux/hte.h + + +More on the HTE timestamp data +------------------------------ +The struct hte_ts_data is used to pass timestamp details between the consumers +and the providers. It expresses timestamp data in nano second in u64 data
nanosesconds
possibly: in a __u64 data
Documentation/hte/hte.rst line 42
Quoted 1 line
Documentation/hte/hte.rst new file +1
-0+type. For now all the HTE APIs using struct hte_ts_data requires tsc to be in
require tsc to be in
Documentation/hte/hte.rst line 43
Quoted 1 line
Documentation/hte/hte.rst new file +1
-0+nano seconds. An example of the typical hte_ts_data data life cycle, for the
nanoseconds.
Documentation/hte/hte.rst line 48
Quoted 5 lines
Documentation/hte/hte.rst new file +5
-0+GPIO line is as follows:: + + - Monitors GPIO line change. + - Detects the state change on GPIO line. + - Converts timestamps in nano seconds and stores it in tsc.
nanoseconds
Documentation/hte/hte.rst line 53
Quoted 5 lines
Documentation/hte/hte.rst new file +5
-0+ - Stores GPIO direction in dir variable if the provider has that hardware + capability. + - Pushes this hte_ts_data object to HTE subsystem. + - HTE subsystem increments seq counter and invokes consumer provided callback. + Based on callback return value, the HTE starts kernel thread and invokes
starts a kernel thread
Documentation/hte/hte.rst line 59
Quoted 6 lines
Documentation/hte/hte.rst new file +6
-0+ secondary callback in the thread context. + +HTE subsystem debugfs attributes +-------------------------------- +HTE subsystem creates debugfs attributes at ``/sys/kernel/debug/hte/``. +It also creates line/signal related debugfs attributes at
signal-related
Documentation/hte/hte.rst line 64
Quoted 5 lines
Documentation/hte/hte.rst new file +5
-0+``/sys/kernel/debug/hte/<provider>/<label or line id>/``. + +`ts_requested` + The total number of entities requested from the given provider, + where entity is the provider specific and could represent
is specified by the provider and could
(just guessing here; I could not parse it.)
Documentation/hte/hte.rst line 66
Quoted 2 lines
Documentation/hte/hte.rst new file +2
-0+ lines, GPIO, chip signals, buses etc... + The attribute will be availble at
available
Documentation/hte/hte.rst line 69
Quoted 3 lines
Documentation/hte/hte.rst new file +3
-0+ ``/sys/kernel/debug/hte/<provider>/``. + + Read only value
Read-only value
Documentation/hte/hte.rst line 73
Quoted 4 lines
Documentation/hte/hte.rst new file +4
-0+ +`total_ts` + The total number of entities supported by the provider. + The attribute will be availble at
available
Documentation/hte/hte.rst line 69
Quoted 3 lines
Documentation/hte/hte.rst new file +3
-0+ ``/sys/kernel/debug/hte/<provider>/``. + + Read only value
Read-only value
Documentation/hte/hte.rst line 80
Quoted 4 lines
Documentation/hte/hte.rst new file +4
-0+ +`dropped_timestamps` + The dropped timestamps for a given line. + The attribute will be availble at
available
Documentation/hte/hte.rst line 69
Quoted 3 lines
Documentation/hte/hte.rst new file +3
-0+ ``/sys/kernel/debug/hte/<provider>/<label or line id>/``. + + Read only value
Read-only value
Quoted 1 line
Signature · 1 line
~Randy
Dipen Patel
maintainerRe: [RFC v2 01/11] Documentation: Add HTE subsystem guide
Hi Randy,
Thanks for the comments, will implement all your suggestions in RFC V3.
Quoted 148 lines · Randy Dunlap
Quoted 22 lines · Dipen Patel
Adding hte document which can help understand various APIs implemented in HTE framework for the HTE producers and the consumers.
Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- Removed explanation, instead added kernel-doc references.
Documentation/hte/hte.rst| 83 +++++++++++++++++++++++++++++++++++++++1 file changed, 83 insertions(+)create mode 100644
Documentation/hte/hte.rstDocumentation/hte/hte.rst new file +4
-0@@ -0,0 +1,83 @@ +============================================ +The Linux Hardware Timestamping Engine (HTE) +============================================ +Documentation/hte/hte.rst line 14
Quoted 10 lines
Documentation/hte/hte.rst new file +10
-0+:Author: Dipen Patel + +Introduction +------------ + +Certain devices have built in hardware timestamping engines which can +monitor sets of system signals, lines, buses etc... in realtime for state +change; upon detecting the change they can automatically store the timestamp at +the moment of occurrence. Such functionality may help achieve better accuracy +in obtaining timestamp than using software counterparts i.e. ktime and friends.timestamps
Quoted 17 lines
Documentation/hte/hte.rst new file +17
-0+ +This document describes the API that can be used by hardware timestamping +engine provider and consumer drivers that want to use the hardware timestamping +engine (HTE) framework. Both consumers and providers must +#include <linux/hte.h>. + +The HTE framework APIs for the providers +---------------------------------------- + +.. kernel-doc:: drivers/hte/hte.c + :functions: devm_hte_register_chip hte_push_ts_ns + +The HTE framework APIs for the consumers +---------------------------------------- + +.. kernel-doc:: drivers/hte/hte.c + :functions: devm_of_hte_request_ts hte_req_ts_by_hte_name hte_release_ts hte_enable_ts hte_disable_ts hte_get_clk_src_infoDocumentation/hte/hte.rst line 41
Quoted 10 lines
Documentation/hte/hte.rst new file +10
-0+ +The HTE framework public structures +----------------------------------- +.. kernel-doc:: include/linux/hte.h + + +More on the HTE timestamp data +------------------------------ +The struct hte_ts_data is used to pass timestamp details between the consumers +and the providers. It expresses timestamp data in nano second in u64 datananosesconds possibly: in a
__u64dataDocumentation/hte/hte.rst line 42
Quoted 1 line
Documentation/hte/hte.rst new file +1
-0+type. For now all the HTE APIs using struct hte_ts_data requires tsc to be inrequire tsc to be in
Documentation/hte/hte.rst line 43
Quoted 1 line
Documentation/hte/hte.rst new file +1
-0+nano seconds. An example of the typical hte_ts_data data life cycle, for thenanoseconds.
Documentation/hte/hte.rst line 48
Quoted 5 lines
Documentation/hte/hte.rst new file +5
-0+GPIO line is as follows:: + + - Monitors GPIO line change. + - Detects the state change on GPIO line. + - Converts timestamps in nano seconds and stores it in tsc.nanoseconds
Documentation/hte/hte.rst line 53
Quoted 5 lines
Documentation/hte/hte.rst new file +5
-0+ - Stores GPIO direction in dir variable if the provider has that hardware + capability. + - Pushes this hte_ts_data object to HTE subsystem. + - HTE subsystem increments seq counter and invokes consumer provided callback. + Based on callback return value, the HTE starts kernel thread and invokesstarts a kernel thread
Documentation/hte/hte.rst line 59
Quoted 6 lines
Documentation/hte/hte.rst new file +6
-0+ secondary callback in the thread context. + +HTE subsystem debugfs attributes +-------------------------------- +HTE subsystem creates debugfs attributes at ``/sys/kernel/debug/hte/``. +It also creates line/signal related debugfs attributes atsignal-related
Documentation/hte/hte.rst line 64
Quoted 5 lines
Documentation/hte/hte.rst new file +5
-0+``/sys/kernel/debug/hte/<provider>/<label or line id>/``. + +`ts_requested` + The total number of entities requested from the given provider, + where entity is the provider specific and could representis specified by the provider and could (just guessing here; I could not parse it.)
Documentation/hte/hte.rst line 66
Quoted 2 lines
Documentation/hte/hte.rst new file +2
-0+ lines, GPIO, chip signals, buses etc... + The attribute will be availble atavailable
Documentation/hte/hte.rst line 69
Quoted 3 lines
Documentation/hte/hte.rst new file +3
-0+ ``/sys/kernel/debug/hte/<provider>/``. + + Read only valueRead-only value
Documentation/hte/hte.rst line 73
Quoted 4 lines
Documentation/hte/hte.rst new file +4
-0+ +`total_ts` + The total number of entities supported by the provider. + The attribute will be availble atavailable
Documentation/hte/hte.rst line 69
Quoted 3 lines
Documentation/hte/hte.rst new file +3
-0+ ``/sys/kernel/debug/hte/<provider>/``. + + Read only valueRead-only value
Documentation/hte/hte.rst line 80
Quoted 4 lines
Documentation/hte/hte.rst new file +4
-0+ +`dropped_timestamps` + The dropped timestamps for a given line. + The attribute will be availble atavailable
Documentation/hte/hte.rst line 69
Quoted 3 lines
Documentation/hte/hte.rst new file +3
-0+ ``/sys/kernel/debug/hte/<provider>/<label or line id>/``. + + Read only valueRead-only value
Quoted 1 line
Dipen Patel
maintainerRFC v2 2/11 drivers: Add hardware timestamp engine (HTE)
In reply to Dipen PatelSome devices can timestamp system lines/signals/Buses in real-time using the hardware counter or other hardware means which can give finer granularity and help avoid jitter introduced by software timestamping. To utilize such functionality, this patchset creates HTE subsystem where devices can register themselves as providers so that the consumers devices can request specific line from the providers.
It provides below APIs for the provider:
- devm_hte_register_chip -- To register the HTE provider.
- hte_push_ts_ns() -- To push timestamp data into HTE subsystem.
It provides below APIs for the consumer:
- devm_of_hte_request_ts() -- Request timestamp functionality.
- hte_req_ts_by_hte_name() -- To request timestamp functionality by using HTE provider dt node.
- hte_enable_ts() -- To disable timestamp functionality.
- hte_disable_ts() -- To enable timestamp functionality.
- hte_release_ts() -- To release timestamp functionality and its associated resources.
- hte_get_clk_src_info() -- To query clock source information from the provider
The detail about parameters and API usage are described in each functions definitions in drivers/hte/hte.c file.
The patch adds compilation support in Makefile and menu options in Kconfig.
---
Changes in v2:
- Removed buffer abstraction layer as well related APIs, HTE now will not store any data, instead will pass to consumer as soon as it is available.
- Removed unnecessary dynamical allocations
- Removed timestamp retrieve API
- Removed release, unregister related APIs as their counterpart are resource managed.
- Added kernel thread implementation if consumer indicates threaded callback during request API time.
- Changed hte_req_ts_by_dt_node API to remove device node exposure from the interface, instead consumer will their device node with property name that indicates the provider it wants to use.
drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/hte/Kconfig | 22 ++ drivers/hte/Makefile | 2 + drivers/hte/hte.c | 907 +++++++++++++++++++++++++++++++++++++++++++ include/linux/hte.h | 248 ++++++++++++ 6 files changed, 1182 insertions(+) create mode 100644 drivers/hte/Kconfig create mode 100644 drivers/hte/Makefile create mode 100644 drivers/hte/hte.c create mode 100644 include/linux/hte.h
drivers/Kconfig +2 -0
@@ -234,4 +234,6 @@ source "drivers/interconnect/Kconfig" source "drivers/counter/Kconfig" source "drivers/most/Kconfig" + +source "drivers/hte/Kconfig" endmenu
drivers/Makefile +1 -0
@@ -188,3 +188,4 @@ obj-$(CONFIG_GNSS) += gnss/ obj-$(CONFIG_INTERCONNECT) += interconnect/ obj-$(CONFIG_COUNTER) += counter/ obj-$(CONFIG_MOST) += most/ +obj-$(CONFIG_HTE) += hte/
drivers/hte/Kconfig new file +22 -0
@@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0-only +menuconfig HTE + bool "Hardware Timestamping Engine (HTE) Support" + help + Hardware Timestamping Engine (HTE) Support. + + Some devices provide hardware timestamping engine which can timestamp + certain device lines/signals in realtime. This way to provide + hardware assisted timestamp to generic signals like GPIOs, IRQs lines + comes with benefit for the applications like autonomous machines + needing accurate timestamping event with less jitter. + + This framework provides a generic interface to such HTE devices + within the Linux kernel. It provides an API to register and + unregister a HTE provider chip, configurable sw buffer to + store the timestamps, push the timestamp from the HTE providers and + retrieve timestamps for the consumers. It also provides means for the + consumers to request signals it wishes to hardware timestamp and + release them if not required. + + If unsure, say no. +
drivers/hte/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_HTE) += hte.o +
drivers/hte/hte.c new file +907 -0
907 lines not on this page · raw message
include/linux/hte.h new file +248 -0
248 lines not on this page · raw message
Signature · 1 line
2.17.1
Randy Dunlap
reviewerRe: [RFC v2 02/11] drivers: Add hardware timestamp engine (HTE)
drivers/hte/Kconfig line 7
Quoted 13 lines · Dipen Patel
drivers/hte/Kconfig new file +7
-0@@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0-only +menuconfig HTE + bool "Hardware Timestamping Engine (HTE) Support" + help + Hardware Timestamping Engine (HTE) Support. + + Some devices provide hardware timestamping engine which can timestamp
provide a hardware
drivers/hte/Kconfig line 8
Quoted 1 line
drivers/hte/Kconfig new file +1
-0+ certain device lines/signals in realtime. This way to provide
This provides a
drivers/hte/Kconfig line 9
Quoted 1 line
drivers/hte/Kconfig new file +1
-0+ hardware assisted timestamp to generic signals like GPIOs, IRQs lines
hardware-assisted like GPIOs or IRQ lines.
drivers/hte/Kconfig line 10
Quoted 1 line
drivers/hte/Kconfig new file +1
-0+ comes with benefit for the applications like autonomous machines
It comes with a benefit for applications like
drivers/hte/Kconfig line 15
Quoted 5 lines
drivers/hte/Kconfig new file +5
-0+ needing accurate timestamping event with less jitter. + + This framework provides a generic interface to such HTE devices + within the Linux kernel. It provides an API to register and + unregister a HTE provider chip, configurable sw buffer to
software
drivers/hte/Kconfig line 21
Quoted 6 lines
drivers/hte/Kconfig new file +6
-0+ store the timestamps, push the timestamp from the HTE providers and + retrieve timestamps for the consumers. It also provides means for the + consumers to request signals it wishes to hardware timestamp and + release them if not required. + + If unsure, say no.
HTH.
Signature · 1 line
~Randy
Dipen Patel
maintainerRe: [RFC v2 02/11] drivers: Add hardware timestamp engine (HTE)
Hi Randy,
I will implement all your suggestions in RFC v3.
Best Regards,
Dipen Patel
Quoted 47 lines · Randy Dunlap
drivers/hte/Kconfig line 7
Quoted 13 lines · Dipen Patel
drivers/hte/Kconfig new file +7
-0@@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0-only +menuconfig HTE + bool "Hardware Timestamping Engine (HTE) Support" + help + Hardware Timestamping Engine (HTE) Support. + + Some devices provide hardware timestamping engine which can timestampprovide a hardware
drivers/hte/Kconfig line 8
Quoted 1 line
drivers/hte/Kconfig new file +1
-0+ certain device lines/signals in realtime. This way to provideThis provides a
drivers/hte/Kconfig line 9
Quoted 1 line
drivers/hte/Kconfig new file +1
-0+ hardware assisted timestamp to generic signals like GPIOs, IRQs lineshardware-assisted like GPIOs or IRQ lines.
drivers/hte/Kconfig line 10
Quoted 1 line
drivers/hte/Kconfig new file +1
-0+ comes with benefit for the applications like autonomous machinesIt comes with a benefit for applications like
drivers/hte/Kconfig line 15
Quoted 5 lines
drivers/hte/Kconfig new file +5
-0+ needing accurate timestamping event with less jitter. + + This framework provides a generic interface to such HTE devices + within the Linux kernel. It provides an API to register and + unregister a HTE provider chip, configurable sw buffer tosoftware
drivers/hte/Kconfig line 21
Quoted 6 lines
drivers/hte/Kconfig new file +6
-0+ store the timestamps, push the timestamp from the HTE providers and + retrieve timestamps for the consumers. It also provides means for the + consumers to request signals it wishes to hardware timestamp and + release them if not required. + + If unsure, say no.HTH.
Dipen Patel
maintainerRFC v2 3/11 hte: Add tegra194 HTE kernel provider
In reply to Dipen PatelTegra194 device has multiple HTE instances also known as GTE (Generic hardware Timestamping Engine) which can timestamp subset of SoC lines/signals. This provider driver focuses on IRQ and GPIO lines and exposes timestamping ability on those lines to the consumers through HTE subsystem.
Also, with this patch, added:
- documentation about this provider and its capabilities at Documentation/hte.
- Compilation support in Makefile and Kconfig
--- Documentation/hte/index.rst | 22 ++ Documentation/hte/tegra194-hte.rst | 56 +++ Documentation/index.rst | 1 + drivers/hte/Kconfig | 12 + drivers/hte/Makefile | 1 + drivers/hte/hte-tegra194.c | 554 +++++++++++++++++++++++++++++ 6 files changed, 646 insertions(+) create mode 100644 Documentation/hte/index.rst create mode 100644 Documentation/hte/tegra194-hte.rst create mode 100644 drivers/hte/hte-tegra194.c
Documentation/hte/index.rst new file +22 -0
@@ -0,0 +1,22 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============================================ +The Linux Hardware Timestamping Engine (HTE) +============================================ + +The HTE Subsystem +================= + +.. toctree:: + :maxdepth: 1 + + hte + +HTE Tegra Provider +================== + +.. toctree:: + :maxdepth: 1 + + tegra194-hte +
Documentation/hte/tegra194-hte.rst new file +56 -0
56 lines not on this page · raw message
Documentation/index.rst +1 -0
@@ -138,6 +138,7 @@ needed). misc-devices/index scheduler/index mhi/index + hte/index Architecture-agnostic documentation -----------------------------------
drivers/hte/Kconfig +12 -0
@@ -20,3 +20,15 @@ menuconfig HTE If unsure, say no. +if HTE + +config HTE_TEGRA194 + tristate "NVIDIA Tegra194 HTE Support" + depends on ARCH_TEGRA_194_SOC + help + Enable this option for integrated hardware timestamping engine also + known as generic timestamping engine (GTE) support on NVIDIA Tegra194 + systems-on-chip. The driver supports 352 LIC IRQs and 39 AON GPIOs + lines for timestamping in realtime. + +endif
drivers/hte/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_HTE) += hte.o +obj-$(CONFIG_HTE_TEGRA194) += hte-tegra194.o
drivers/hte/hte-tegra194.c new file +554 -0
554 lines not on this page · raw message
Signature · 1 line
2.17.1
Randy Dunlap
reviewerRe: [RFC v2 03/11] hte: Add tegra194 HTE kernel provider
Documentation/hte/tegra194-hte.rst line 17
Quoted 13 lines · Dipen Patel
+-----------
Documentation/hte/tegra194-hte.rst new file +12
-0+The Nvidia tegra194 HTE provider driver implements two GTE +(Generic Timestamping Engine) instances 1) GPIO GTE and 2) LIC IRQ GTE. The +both GTEs instances get the timestamp from the system counter TSC which has +31.25MHz clock rate, and the driver converts clock tick rate to nano seconds +before storing it as timestamp value. + +GPIO GTE +-------- + +This GTE instance timestamps GPIO in real time, for that to happen GPIO +needs to be configured as input and IRQ needs to ba enabled. The only always on +(AON) gpio controller instance supports timestamping GPIOs in realtime and it
Here we have text that tells what AON means, but in the first paragraph above, there is nothing that tells us what LIC means. Please add that.
Signature · 1 line
~Randy
Randy Dunlap
reviewerRe: [RFC v2 03/11] hte: Add tegra194 HTE kernel provider
In reply to Dipen PatelDocumentation/hte/tegra194-hte.rst line 7
Quoted 13 lines · Dipen Patel
Documentation/hte/tegra194-hte.rst new file +7
-0@@ -0,0 +1,56 @@ +HTE Kernel provider driver +========================== + +Description +----------- +The Nvidia tegra194 HTE provider driver implements two GTE +(Generic Timestamping Engine) instances 1) GPIO GTE and 2) LIC IRQ GTE. The
instances: ^^Drop "The"
Documentation/hte/tegra194-hte.rst line 8
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+both GTEs instances get the timestamp from the system counter TSC which has
Both
Documentation/hte/tegra194-hte.rst line 9
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+31.25MHz clock rate, and the driver converts clock tick rate to nano seconds
nanoseconds
Documentation/hte/tegra194-hte.rst line 15
Quoted 6 lines
Documentation/hte/tegra194-hte.rst new file +6
-0+before storing it as timestamp value. + +GPIO GTE +-------- + +This GTE instance timestamps GPIO in real time, for that to happen GPIO
time. For
Documentation/hte/tegra194-hte.rst line 16
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+needs to be configured as input and IRQ needs to ba enabled. The only always on
be
Documentation/hte/tegra194-hte.rst line 17
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+(AON) gpio controller instance supports timestamping GPIOs in realtime and it
GPIO real time {or change
the instance 3 lines above to be "realtime"}
Documentation/hte/tegra194-hte.rst line 21
Quoted 3 lines
Documentation/hte/tegra194-hte.rst new file +3
-0+has 39 GPIO lines. The GPIO GTE and AON GPIO controller are tightly coupled as +it requires very specific bits to be set in GPIO config register before GPIO> +GTE can be used. The GPIO GTE functionality is accessed from the GPIOLIB +framework for the in kernel and userspace consumers. In the later case,
in-kernel latter
Documentation/hte/tegra194-hte.rst line 32
Quoted 11 lines
Documentation/hte/tegra194-hte.rst new file +11
-0+requests go through GPIOLIB CDEV framework. The below APIs are added in GPIOLIB +framework to access HTE subsystem and GPIO GTE. + +.. kernel-doc:: drivers/gpio/gpiolib.c + :functions: gpiod_req_hw_timestamp_ns gpiod_rel_hw_timestamp_ns + +There is hte-tegra194-gpio-test.c, located in ``drivers/hte/`` directory, test +driver which demonstrates above APIs for the Jetson AGX platform. + +For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE flag must be +specifed during IOCTL calls, refer ``tools/gpio/gpio-event-mon.c``, which
specified calls. Refer to
Documentation/hte/tegra194-hte.rst line 33
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+returns the timestamp in nano second.
nanoseconds.
Documentation/hte/tegra194-hte.rst line 38
Quoted 5 lines
Documentation/hte/tegra194-hte.rst new file +5
-0+ +LIC IRQ GTE +----------- + +This GTE instance timestamp LIC IRQ lines in real time. There are 352 IRQ
timestamps ^^^^^^^^^ {be consistent}(also (repeating a prior email) define "LIC")
Documentation/hte/tegra194-hte.rst line 39
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+lines which this instance can help timestamp realtime. The hte devicetree
can add timestamps to in realtime.
Documentation/hte/tegra194-hte.rst line 40
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+binding described at ``Documentation/devicetree/bindings/hte/`` gives out
provides an
Documentation/hte/tegra194-hte.rst line 41
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+example how consumer can request IRQ line, since it is one to one mapping,
example of how a consumer can request an IRQ line. Since it is a one-to-one mapping,
Documentation/hte/tegra194-hte.rst line 42
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+consumers can simply specify IRQ number that they are interested in. There is
specify the IRQ number
Documentation/hte/tegra194-hte.rst line 44
Quoted 2 lines
Documentation/hte/tegra194-hte.rst new file +2
-0+no userspace consumer support for this GTE instance. The sample test code +hte-tegra194-irq-test.c, located in ``drivers/hte/`` directory,
in the
Documentation/hte/tegra194-hte.rst line 45
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+demonstrates how to use IRQ GTE instance. The below is sample device tree
how to use an IRQ GTE instance.
Documentation/hte/tegra194-hte.rst line 54
Quoted 9 lines
Documentation/hte/tegra194-hte.rst new file +9
-0+snippet code for the test driver:: + + tegra_hte_irq_test { + compatible = "nvidia,tegra194-hte-irq-test"; + htes = <&tegra_hte_lic 0x19>; + hte-names = "hte-lic"; + }; + +The provider source code of both IRQ and GPIO GTE instances is locate at
located
Quoted 2 lines
Documentation/hte/tegra194-hte.rst new file +2
-0+``drivers/hte/hte-tegra194.c``. +
Signature · 1 line
~Randy
Dipen Patel
maintainerRe: [RFC v2 03/11] hte: Add tegra194 HTE kernel provider
Hi Randy,
Thanks for the comments. I will implement changes in RFC V3.
Best Regards,
Dipen Patel
Quoted 117 lines · Randy Dunlap
Documentation/hte/tegra194-hte.rst line 7
Quoted 13 lines · Dipen Patel
Documentation/hte/tegra194-hte.rst new file +7
-0@@ -0,0 +1,56 @@ +HTE Kernel provider driver +========================== + +Description +----------- +The Nvidia tegra194 HTE provider driver implements two GTE +(Generic Timestamping Engine) instances 1) GPIO GTE and 2) LIC IRQ GTE. Theinstances: ^^Drop "The"
Documentation/hte/tegra194-hte.rst line 8
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+both GTEs instances get the timestamp from the system counter TSC which hasBoth
Documentation/hte/tegra194-hte.rst line 9
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+31.25MHz clock rate, and the driver converts clock tick rate to nano secondsnanoseconds
Documentation/hte/tegra194-hte.rst line 15
Quoted 6 lines
Documentation/hte/tegra194-hte.rst new file +6
-0+before storing it as timestamp value. + +GPIO GTE +-------- + +This GTE instance timestamps GPIO in real time, for that to happen GPIOtime. For
Documentation/hte/tegra194-hte.rst line 16
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+needs to be configured as input and IRQ needs to ba enabled. The only always onbe
Documentation/hte/tegra194-hte.rst line 17
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+(AON) gpio controller instance supports timestamping GPIOs in realtime and itGPIO real time {or change the instance 3 lines above to be "realtime"}
Documentation/hte/tegra194-hte.rst line 21
Quoted 3 lines
Documentation/hte/tegra194-hte.rst new file +3
-0+has 39 GPIO lines. The GPIO GTE and AON GPIO controller are tightly coupled as +it requires very specific bits to be set in GPIO config register before GPIO> +GTE can be used. The GPIO GTE functionality is accessed from the GPIOLIB +framework for the in kernel and userspace consumers. In the later case,in-kernel latter
Documentation/hte/tegra194-hte.rst line 32
Quoted 11 lines
Documentation/hte/tegra194-hte.rst new file +11
-0+requests go through GPIOLIB CDEV framework. The below APIs are added in GPIOLIB +framework to access HTE subsystem and GPIO GTE. + +.. kernel-doc:: drivers/gpio/gpiolib.c + :functions: gpiod_req_hw_timestamp_ns gpiod_rel_hw_timestamp_ns + +There is hte-tegra194-gpio-test.c, located in ``drivers/hte/`` directory, test +driver which demonstrates above APIs for the Jetson AGX platform. + +For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE flag must be +specifed during IOCTL calls, refer ``tools/gpio/gpio-event-mon.c``, whichspecified calls. Refer to
Documentation/hte/tegra194-hte.rst line 33
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+returns the timestamp in nano second.nanoseconds.
Documentation/hte/tegra194-hte.rst line 38
Quoted 5 lines
Documentation/hte/tegra194-hte.rst new file +5
-0+ +LIC IRQ GTE +----------- + +This GTE instance timestamp LIC IRQ lines in real time. There are 352 IRQtimestamps ^^^^^^^^^ {be consistent} (also (repeating a prior email) define "LIC")
Documentation/hte/tegra194-hte.rst line 39
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+lines which this instance can help timestamp realtime. The hte devicetreecan add timestamps to in realtime.
Documentation/hte/tegra194-hte.rst line 40
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+binding described at ``Documentation/devicetree/bindings/hte/`` gives outprovides an
Documentation/hte/tegra194-hte.rst line 41
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+example how consumer can request IRQ line, since it is one to one mapping,example of how a consumer can request an IRQ line. Since it is a one-to-one mapping,
Documentation/hte/tegra194-hte.rst line 42
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+consumers can simply specify IRQ number that they are interested in. There isspecify the IRQ number
Documentation/hte/tegra194-hte.rst line 44
Quoted 2 lines
Documentation/hte/tegra194-hte.rst new file +2
-0+no userspace consumer support for this GTE instance. The sample test code +hte-tegra194-irq-test.c, located in ``drivers/hte/`` directory,in the
Documentation/hte/tegra194-hte.rst line 45
Quoted 1 line
Documentation/hte/tegra194-hte.rst new file +1
-0+demonstrates how to use IRQ GTE instance. The below is sample device treehow to use an IRQ GTE instance.
Documentation/hte/tegra194-hte.rst line 54
Quoted 9 lines
Documentation/hte/tegra194-hte.rst new file +9
-0+snippet code for the test driver:: + + tegra_hte_irq_test { + compatible = "nvidia,tegra194-hte-irq-test"; + htes = <&tegra_hte_lic 0x19>; + hte-names = "hte-lic"; + }; + +The provider source code of both IRQ and GPIO GTE instances is locate atlocated
Quoted 2 lines
Documentation/hte/tegra194-hte.rst new file +2
-0+``drivers/hte/hte-tegra194.c``. +
Dipen Patel
maintainerRFC v2 4/11 dt-bindings: Add HTE bindings
In reply to Dipen PatelIntroduces HTE devicetree binding details for the HTE subsystem. It includes examples for the consumers, binding details for the providers and specific binding details for the Tegra194 based HTE providers.
---
Changes in v2:
- Replace hte with hardware-timestamp for property names
- Renamed file
- Removed example from the common dt binding file.
.../hte/hardware-timestamps-common.yaml | 29 +++++++ .../devicetree/bindings/hte/hte-consumer.yaml | 48 +++++++++++ .../bindings/hte/nvidia,tegra194-hte.yaml | 79 +++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml create mode 100644 Documentation/devicetree/bindings/hte/hte-consumer.yaml create mode 100644 Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +29 -0
@@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/hardware-timestamps-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hardware timestamp providers + +maintainers: + - Dipen Patel <[email protected]> + +description: | + Some devices/SoCs have hardware time stamping engines which can use hardware + means to timestamp entity in realtime. The entity could be anything from + GPIOs, IRQs, Bus and so on. The hardware timestamp engine (HTE) present + itself as a provider with the bindings described in this document. + +properties: + $nodename: + pattern: "^hardware-timestamps(@.*|-[0-9a-f])*$" + + "#hardware-timestamps-cells": + description: + Number of cells in a HTE specifier. + +required: + - "#hardware-timestamps-cells" + +additionalProperties: true
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +48 -0
48 lines not on this page · raw message
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +79 -0
79 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [RFC v2 04/11] dt-bindings: Add HTE bindings
Quoted 10 lines · Dipen Patel
Introduces HTE devicetree binding details for the HTE subsystem. It includes examples for the consumers, binding details for the providers and specific binding details for the Tegra194 based HTE providers.
Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- Replace hte with hardware-timestamp for property names
- Renamed file
- Removed example from the common dt binding file.
This looks good to me!
Yours,
Linus Walleij
Rob Herring
maintainerRe: [RFC v2 04/11] dt-bindings: Add HTE bindings
In reply to Dipen PatelQuoted 4 lines · Dipen Patel
Introduces HTE devicetree binding details for the HTE subsystem. It includes examples for the consumers, binding details for the providers and specific binding details for the Tegra194 based HTE providers.
This pattern of binding isn't easily checked completely by schema. You need a dtc check added too. Should be a 2 line change. (And dtc changes go upstream first).
Quoted 21 lines
Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- Replace hte with hardware-timestamp for property names
- Renamed file
- Removed example from the common dt binding file..../hte/hardware-timestamps-common.yaml | 29 +++++++ .../devicetree/bindings/hte/hte-consumer.yaml | 48 +++++++++++ .../bindings/hte/nvidia,tegra194-hte.yaml | 79 +++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml create mode 100644 Documentation/devicetree/bindings/hte/hte-consumer.yaml create mode 100644 Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yamlDocumentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +0
-0
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml line 1
Quoted 1 line
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +1
-0@@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0
Dual license new bindings.
Quoted 9 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +9
-0+%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/hardware-timestamps-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hardware timestamp providers + +maintainers: + - Dipen Patel <[email protected]>
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml line 20
Quoted 10 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +10
-0+ +description: | + Some devices/SoCs have hardware time stamping engines which can use hardware + means to timestamp entity in realtime. The entity could be anything from + GPIOs, IRQs, Bus and so on. The hardware timestamp engine (HTE) present + itself as a provider with the bindings described in this document. + +properties: + $nodename: + pattern: "^hardware-timestamps(@.*|-[0-9a-f])*$"
"^hardware-timestamp(@.*|-[0-9a-f])?$"
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml line 22
Quoted 2 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +2
-0+ + "#hardware-timestamps-cells":
Double plural:
#hardware-timestamp-cells
Arguably, the same string everywhere would have been an easier design, but let's keep consistency with (most) other flavors of this pattern.
Quoted 33 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +7
-0+ description: + Number of cells in a HTE specifier. + +required: + - "#hardware-timestamps-cells" + +additionalProperties: trueDocumentation/devicetree/bindings/hte/hte-consumer.yaml new file +20
-0@@ -0,0 +1,48 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/hte-consumer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HTE Consumer Device Tree Bindings + +maintainers: + - Dipen Patel <[email protected]> + +description: | + HTE properties should be named "hardware-timestamps". The exact meaning of + each hardware-timestamps property must be documented in the device tree + binding for each device. An optional property "hardware-timestamps-names" may + contain a list of strings to label each of the HTE devices listed in the + "hardware-timestamps" property. + + The "hardware-timestamps-names" property if specified is used to map the name + of the HTE device requested by the devm_of_hte_request_ts() or of_hte_request_ts
Documentation/devicetree/bindings/hte/hte-consumer.yaml line 30
Quoted 10 lines
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +10
-0+ call to an index into the list given by the "hardware-timestamps" property. + +properties: + hardware-timestamps: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + The list of HTE provider phandle. The provider must document the number + of cell that must be passed in this property along with phandle. + + hardware-timestamps-names:
hardware-timestamp-names
Documentation/devicetree/bindings/hte/hte-consumer.yaml line 36
Quoted 6 lines
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +6
-0+ $ref: /schemas/types.yaml#/definitions/string-array + description: + An optional string property. + +required: + - "hardware-timestamps"
Don't need quotes.
Quoted 24 lines
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +12
-0+ +dependencies: + hardware-timestamps-names: [ hardware-timestamps ] + +additionalProperties: true + +examples: + - | + hte_irq_consumer { + hardware-timestamps = <&tegra_hte_lic 0x19>; + hardware-timestamps-names = "hte-irq"; + };Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +6
-0@@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/nvidia,tegra194-hte.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# +
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml line 16
Quoted 10 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +10
-0+title: Tegra194 on chip generic hardware timestamping engine (HTE) + +maintainers: + - Dipen Patel <[email protected]> + +description: | + Tegra194 SoC has multiple generic hardware timestamping engines which can + monitor subset of GPIO and on chip IRQ lines for the state change, upon + detection it will record timestamp (taken from system counter) in its + internal hardware FIFO. It has bitmap array arranged in 32bit slices where
has a bitmap
Quoted 6 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +6
-0+ each bit represent signal/line to enable or disable for the hardware + timestamping. + +properties: + compatible: + enum:
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml line 32
Quoted 10 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +10
-0+ - nvidia,tegra194-gte-aon + - nvidia,tegra194-gte-lic + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + int-threshold:
nvidia,int-threshold unless this is common for all hw timestamps?
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml line 39
Quoted 7 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +7
-0+ description: + HTE device generates its interrupt based on this u32 FIFO threshold + value. The recommended value is 1. + minimum: 1 + maximum: 256 + + slices:
nvidia,slices
Needs a type.
Quoted 44 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +40
-0+ description: + HTE lines are arranged in 32 bit slice where each bit represents different + line/signal that it can enable/configure for the timestamp. It is u32 + property and depends on the HTE instance in the chip. + enum: [3, 11] + + '#hardware-timestamps-cells': + const: 1 + +required: + - compatible + - reg + - interrupts + - slices + - "#hardware-timestamps-cells" + +additionalProperties: false + +examples: + - | + tegra_hte_aon: hardware-timestamps@c1e0000 { + compatible = "nvidia,tegra194-gte-aon"; + reg = <0xc1e0000 0x10000>; + interrupts = <0 13 0x4>; + int-threshold = <1>; + slices = <3>; + #hardware-timestamps-cells = <1>; + }; + + - | + tegra_hte_lic: hardware-timestamps@3aa0000 { + compatible = "nvidia,tegra194-gte-lic"; + reg = <0x3aa0000 0x10000>; + interrupts = <0 11 0x4>; + int-threshold = <1>; + slices = <11>; + #hardware-timestamps-cells = <1>; + }; + +...Signature · 1 line
2.17.1
Dipen Patel
maintainerRe: [RFC v2 04/11] dt-bindings: Add HTE bindings
Hi Rob,
Quoted 8 lines · Rob Herring
Quoted 4 lines · Dipen Patel
Introduces HTE devicetree binding details for the HTE subsystem. It includes examples for the consumers, binding details for the providers and specific binding details for the Tegra194 based HTE providers.
This pattern of binding isn't easily checked completely by schema. You need a dtc check added too. Should be a 2 line change. (And dtc changes go upstream first).
Sorry, I could not understand your comment. Can you please elaborate?
Quoted 16 lines
Quoted 16 lines
Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- Replace hte with hardware-timestamp for property names
- Renamed file
- Removed example from the common dt binding file..../hte/hardware-timestamps-common.yaml | 29 +++++++ .../devicetree/bindings/hte/hte-consumer.yaml | 48 +++++++++++ .../bindings/hte/nvidia,tegra194-hte.yaml | 79 +++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml create mode 100644 Documentation/devicetree/bindings/hte/hte-consumer.yaml create mode 100644 Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml
Quoted 8 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml line 1
Quoted 7 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +1
-0@@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0Dual license new bindings.
Do you mean to add SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) instead?
Quoted 194 lines
Quoted 10 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +9
-0+%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/hardware-timestamps-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hardware timestamp providers + +maintainers: + - Dipen Patel <[email protected]>Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml line 20
Quoted 10 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +10
-0+ +description: | + Some devices/SoCs have hardware time stamping engines which can use hardware + means to timestamp entity in realtime. The entity could be anything from + GPIOs, IRQs, Bus and so on. The hardware timestamp engine (HTE) present + itself as a provider with the bindings described in this document. + +properties: + $nodename: + pattern: "^hardware-timestamps(@.*|-[0-9a-f])*$""^hardware-timestamp(@.*|-[0-9a-f])?$"
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml line 22
Quoted 2 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +2
-0+ + "#hardware-timestamps-cells":Double plural:
#hardware-timestamp-cells
Arguably, the same string everywhere would have been an easier design, but let's keep consistency with (most) other flavors of this pattern.
Quoted 33 lines
Documentation/devicetree/bindings/hte/hardware-timestamps-common.yaml new file +7
-0+ description: + Number of cells in a HTE specifier. + +required: + - "#hardware-timestamps-cells" + +additionalProperties: trueDocumentation/devicetree/bindings/hte/hte-consumer.yaml new file +20
-0@@ -0,0 +1,48 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/hte-consumer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HTE Consumer Device Tree Bindings + +maintainers: + - Dipen Patel <[email protected]> + +description: | + HTE properties should be named "hardware-timestamps". The exact meaning of + each hardware-timestamps property must be documented in the device tree + binding for each device. An optional property "hardware-timestamps-names" may + contain a list of strings to label each of the HTE devices listed in the + "hardware-timestamps" property. + + The "hardware-timestamps-names" property if specified is used to map the name + of the HTE device requested by the devm_of_hte_request_ts() or of_hte_request_tsDocumentation/devicetree/bindings/hte/hte-consumer.yaml line 30
Quoted 10 lines
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +10
-0+ call to an index into the list given by the "hardware-timestamps" property. + +properties: + hardware-timestamps: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + The list of HTE provider phandle. The provider must document the number + of cell that must be passed in this property along with phandle. + + hardware-timestamps-names:hardware-timestamp-names
Documentation/devicetree/bindings/hte/hte-consumer.yaml line 36
Quoted 6 lines
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +6
-0+ $ref: /schemas/types.yaml#/definitions/string-array + description: + An optional string property. + +required: + - "hardware-timestamps"Don't need quotes.
Quoted 24 lines
Documentation/devicetree/bindings/hte/hte-consumer.yaml new file +12
-0+ +dependencies: + hardware-timestamps-names: [ hardware-timestamps ] + +additionalProperties: true + +examples: + - | + hte_irq_consumer { + hardware-timestamps = <&tegra_hte_lic 0x19>; + hardware-timestamps-names = "hte-irq"; + };Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +6
-0@@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hte/nvidia,tegra194-hte.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# +Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml line 16
Quoted 10 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +10
-0+title: Tegra194 on chip generic hardware timestamping engine (HTE) + +maintainers: + - Dipen Patel <[email protected]> + +description: | + Tegra194 SoC has multiple generic hardware timestamping engines which can + monitor subset of GPIO and on chip IRQ lines for the state change, upon + detection it will record timestamp (taken from system counter) in its + internal hardware FIFO. It has bitmap array arranged in 32bit slices wherehas a bitmap
Quoted 6 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +6
-0+ each bit represent signal/line to enable or disable for the hardware + timestamping. + +properties: + compatible: + enum:Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml line 32
Quoted 10 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +10
-0+ - nvidia,tegra194-gte-aon + - nvidia,tegra194-gte-lic + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + int-threshold:nvidia,int-threshold unless this is common for all hw timestamps?
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml line 39
Quoted 7 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +7
-0+ description: + HTE device generates its interrupt based on this u32 FIFO threshold + value. The recommended value is 1. + minimum: 1 + maximum: 256 + + slices:nvidia,slices
Needs a type.
Quoted 44 lines
Documentation/devicetree/bindings/hte/nvidia,tegra194-hte.yaml new file +40
-0+ description: + HTE lines are arranged in 32 bit slice where each bit represents different + line/signal that it can enable/configure for the timestamp. It is u32 + property and depends on the HTE instance in the chip. + enum: [3, 11] + + '#hardware-timestamps-cells': + const: 1 + +required: + - compatible + - reg + - interrupts + - slices + - "#hardware-timestamps-cells" + +additionalProperties: false + +examples: + - | + tegra_hte_aon: hardware-timestamps@c1e0000 { + compatible = "nvidia,tegra194-gte-aon"; + reg = <0xc1e0000 0x10000>; + interrupts = <0 13 0x4>; + int-threshold = <1>; + slices = <3>; + #hardware-timestamps-cells = <1>; + }; + + - | + tegra_hte_lic: hardware-timestamps@3aa0000 { + compatible = "nvidia,tegra194-gte-lic"; + reg = <0x3aa0000 0x10000>; + interrupts = <0 11 0x4>; + int-threshold = <1>; + slices = <11>; + #hardware-timestamps-cells = <1>; + }; + +...Signature · 1 line
2.17.1
Dipen Patel
maintainerRFC v2 5/11 hte: Add Tegra194 IRQ HTE test driver
In reply to Dipen PatelTegra194 has IRQ HTE provider which can timestamp IRQ lines in realtime , this test driver implements consumer side which tests such provider through HTE subsystem. During its probe, it registers sysfs interface to easily navigate from userspace as below.
All the files are at /sys/kernel/tegra_hte_irq_test/.
- en_dis - Write only, Value 1 enables HTE line, 0 disables it
Its devicetree detail can be accessed fromDocumentation/hte/tegra194-hte.rst.
This driver can be compiled as loadable module and is tested on Jetson AGX platform using 0x19 IRQ line which belongs to i2c controller 3160000.i2c.
i2cdetect -y 1 from the userspace on this platform should be enough to generate LIC I2C IRQ. The HTE should be able to generate timestamps in realtime for each interrupts.
--- drivers/hte/Kconfig | 7 ++ drivers/hte/Makefile | 1 + drivers/hte/hte-tegra194-irq-test.c | 169 ++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 drivers/hte/hte-tegra194-irq-test.c
drivers/hte/Kconfig +7 -0
@@ -31,4 +31,11 @@ config HTE_TEGRA194 systems-on-chip. The driver supports 352 LIC IRQs and 39 AON GPIOs lines for timestamping in realtime. +config HTE_TEGRA194_IRQ_TEST + tristate "NVIDIA Tegra194 HTE LIC IRQ Test" + depends on HTE_TEGRA194 + help + The NVIDIA Tegra194 GTE IRQ test driver demonstrates HTE subsystem + usage for the LIC IRQ hardware timestamp. + endif
drivers/hte/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-$(CONFIG_HTE) += hte.o obj-$(CONFIG_HTE_TEGRA194) += hte-tegra194.o +obj-$(CONFIG_HTE_TEGRA194_IRQ_TEST) += hte-tegra194-irq-test.o
drivers/hte/hte-tegra194-irq-test.c new file +169 -0
169 lines not on this page · raw message
Signature · 1 line
2.17.1
Dipen Patel
maintainerRFC v2 6/11 gpiolib: Add HTE support
In reply to Dipen PatelSome GPIO chip can provide hardware timestamp support on its GPIO lines , in order to support that additional API needs to be added which can talk to both GPIO chip and HTE (hardware timestamping engine) subsystem. This patch introduces APIs which gpio consumer can use to request hardware assisted timestamping. Below is the list of the APIs that are added in gpiolib subsystem.
- gpiod_req_hw_timestamp_ns - Request HTE on specified GPIO line.
- gpiod_rel_hw_timestamp_ns - Release HTE functionality on GPIO line.
---
Changes in v2:
- removed get timestamp and is timestamp enabled APIs
drivers/gpio/gpiolib.c | 73 +++++++++++++++++++++++++++++++++++ drivers/gpio/gpiolib.h | 12 ++++++ include/linux/gpio/consumer.h | 19 ++++++++- include/linux/gpio/driver.h | 14 +++++++ 4 files changed, 116 insertions(+), 2 deletions(-)
drivers/gpio/gpiolib.c +73 -0
@@ -1971,6 +1971,10 @@ static bool gpiod_free_commit(struct gpio_desc *desc) gc->free (gc,gpio_chip_hwgpio (desc));spin_lock_irqsave (&gpio_lock, flags); } +spin_unlock_irqrestore (&gpio_lock, flags); +gpiod_rel_hw_timestamp_ns (desc); +spin_lock_irqsave (&gpio_lock, flags); +kfree_const (desc->label);desc_set_label (desc,NULL );clear_bit (FLAG_ACTIVE_LOW , &desc->flags);
@@ -2383,6 +2387,75 @@ int gpiod_direction_output(struct gpio_desc *desc, int value) }EXPORT_SYMBOL_GPL (gpiod_direction_output); +/** +* gpiod_req_hw_timestamp_ns - Enable the hardware assisted timestamp in +* nano second. +* +* @desc: GPIO to enable +* @cb: Callback, will be called when HTE pushes timestamp data. +* @tcb: Threaeded callback, it gets called from kernel thread context and when +* cb returns with HTE_RUN_THREADED_CB return value. +* @data: Client data, will be sent back with tcb and cb. +* +* Certain GPIO chip can rely on hardware assisted timestamp engines which can +* record timestamp at the occurance of the configured events +* i.e. rising/falling on specified GPIO lines. This is helper API to enable hw +* assisted timestamp in nano second. +* +* Return 0 in case of success, else an error code. +*/ +int gpiod_req_hw_timestamp_ns (struct gpio_desc *desc,hte_ts_cb_t cb, +hte_ts_threaded_cb_t tcb,void *data) +{ +struct gpio_chip *gc; +int ret =0 ; + +VALIDATE_DESC (desc); + gc = desc->gdev->chip; + +if (!gc->req_hw_timestamp) { +gpiod_warn (desc,"%s: hw ts not supported\n" , __func__); +return -ENOTSUPP ; + } + + ret = gc->req_hw_timestamp (gc,gpio_chip_hwgpio (desc), cb, tcb, + &desc->hdesc, data); +if (ret) +gpiod_warn (desc,"%s: hw ts request failed\n" , __func__); + +return ret; +} +EXPORT_SYMBOL_GPL (gpiod_req_hw_timestamp_ns); + +/** +* gpiod_rel_hw_timestamp_ns - Release and disable the hardware assisted +* timestamp. +* +* @desc: GPIO to disable +* +* Return 0 in case of success, else an error code. +*/ +int gpiod_rel_hw_timestamp_ns (struct gpio_desc *desc) +{ +struct gpio_chip *gc; +int ret =0 ; + +VALIDATE_DESC (desc); + gc = desc->gdev->chip; + +if (!gc->rel_hw_timestamp) { +gpiod_warn (desc,"%s: hw ts not supported\n" , __func__); +return -ENOTSUPP ; + } + + ret = gc->rel_hw_timestamp (gc,gpio_chip_hwgpio (desc), &desc->hdesc); +if (ret) +gpiod_warn (desc,"%s: hw ts release failed\n" , __func__); + +return ret; +} +EXPORT_SYMBOL_GPL (gpiod_rel_hw_timestamp_ns); +/** * gpiod_set_config - sets @config for a GPIO * @desc: descriptor of the GPIO for which to set the configuration
drivers/gpio/gpiolib.h +12 -0
@@ -15,6 +15,7 @@#include <linux/device.h> #include <linux/module.h> #include <linux/cdev.h> +#include <linux/hte.h> #define GPIOCHIP_NAME "gpiochip"
@@ -117,6 +118,7 @@ struct gpio_desc {#define FLAG_EDGE_RISING 16/* GPIO CDEV detects rising edge events */ #define FLAG_EDGE_FALLING 17/* GPIO CDEV detects falling edge events */ #define FLAG_EVENT_CLOCK_REALTIME 18/* GPIO CDEV reports REALTIME timestamps in events */ +#define FLAG_EVENT_CLOCK_HARDWARE 19/* GPIO CDEV reports hardware timestamps in events */ /* Connection label */ const char *label;
@@ -129,6 +131,16 @@ struct gpio_desc {/* debounce period in microseconds */ unsigned int debounce_period_us;#endif +/* +* Hardware timestamp engine related internal data structure. +* This gets filled out when the consumer calls +* gpiod_req_hw_timestamp_ns to enable hardware timestamping on the +* specified GPIO line. The API calls into HTE subsystem which +* initializes appropriate field of the hdesc. The hdesc will be later +* used with gpiod_rel_hw_timestamp to release hw timestamp +* functionality. +*/ +struct hte_ts_desc hdesc; };#define gpiod_not_found (desc) (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT)
include/linux/gpio/consumer.h +17 -2
@@ -6,6 +6,7 @@#include <linux/bug.h> #include <linux/compiler_types.h> #include <linux/err.h> +#include <linux/hte.h> struct device ;
@@ -112,6 +113,9 @@ int gpiod_get_direction(struct gpio_desc *desc);int gpiod_direction_input (struct gpio_desc *desc);int gpiod_direction_output (struct gpio_desc *desc,int value);int gpiod_direction_output_raw (struct gpio_desc *desc,int value); +int gpiod_req_hw_timestamp_ns (struct gpio_desc *desc,hte_ts_cb_t cb, +hte_ts_threaded_cb_t tcb,void *data); +int gpiod_rel_hw_timestamp_ns (struct gpio_desc *desc);/* Value get/set from non-sleeping context */ int gpiod_get_value (const struct gpio_desc *desc);
@@ -353,8 +357,19 @@ static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)WARN_ON (desc);return -ENOSYS ; } - - +static inline int gpiod_req_hw_timestamp_ns (struct gpio_desc *desc, +hte_ts_cb_t cb, +hte_ts_threaded tcb, +void *data) +{ +WARN_ON (desc); +return -ENOSYS ; +} +static inline int gpiod_rel_hw_timestamp_ns (struct gpio_desc *desc) +{ +WARN_ON (desc); +return -ENOSYS ; +}static inline int gpiod_get_value (const struct gpio_desc *desc) {/* GPIO can never have been requested */
include/linux/gpio/driver.h +14 -0
@@ -10,6 +10,7 @@#include <linux/lockdep.h> #include <linux/pinctrl/pinctrl.h> #include <linux/pinctrl/pinconf-generic.h> +#include <linux/hte.h> /* For hardware timestamping */ struct gpio_desc ;struct of_phandle_args ;
@@ -304,6 +305,10 @@ struct gpio_irq_chip {* @add_pin_ranges: optional routine to initialize pin ranges, to be used when * requires special mapping of the pins that provides GPIO functionality. * It is called after adding GPIO chip and before adding IRQ chip. +* @req_hw_timestamp: Dependent on GPIO chip, an optional routine to +* enable hardware assisted timestamp. +* @rel_hw_timestamp: Dependent on GPIO chip, an optional routine to +* disable/release hardware assisted timestamp. * @base: identifies the first GPIO number handled by this chip; * or, if negative during registration, requests dynamic ID allocation. * DEPRECATION: providing anything non-negative and nailing the base
@@ -399,6 +404,15 @@ struct gpio_chip {int (*add_pin_ranges)(struct gpio_chip *gc); +int (*req_hw_timestamp)(struct gpio_chip *gc, +unsigned int offset, +hte_ts_cb_t cb, +hte_ts_threaded_cb_t tcb, +struct hte_ts_desc *hdesc, +void *data); +int (*rel_hw_timestamp)(struct gpio_chip *chip, +unsigned int offset, +struct hte_ts_desc *hdesc);int base;u16 ngpio;u16 offset;
Signature · 1 line
2.17.1
kernel test robot
build botRe: [RFC v2 06/11] gpiolib: Add HTE support
reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross #…
Hi Dipen,
[FYI, it's a private test report for your RFC patch.] [auto build test ERROR on 2d02a18f75fc81177a4e30f3aaaed9af06cc3adc]
url: https://github.com/0day-ci/linux/commits/Dipen-Patel/Intro-to-Hardware-timestamping-engine/20211001-072745 base: 2d02a18f75fc81177a4e30f3aaaed9af06cc3adc config: ia64-defconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/bd7dcd8a026a55d05ae0b2dba5aaf5a926d9c7b6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Dipen-Patel/Intro-to-Hardware-timestamping-engine/20211001-072745 git checkout bd7dcd8a026a55d05ae0b2dba5aaf5a926d9c7b6
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from drivers/net/phy/mdio_bus.c:17:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18, from include/linux/efi.h:20, from drivers/firmware/efi/efi.c:22:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t drivers/firmware/efi/efi.c:166:16: warning: no previous prototype for 'efi_attr_is_visible' [-Wmissing-prototypes]
166 | umode_t __weak efi_attr_is_visible(struct kobject *kobj, struct attribute *attr,
| ^~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from drivers/firmware/efi/sysfb_efi.c:18:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t drivers/firmware/efi/sysfb_efi.c:72:6: warning: no previous prototype for 'efifb_setup_from_dmi' [-Wmissing-prototypes]
72 | void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
| ^~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from init/main.c:53:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
init/main.c:790:20: warning: no previous prototype for 'mem_encrypt_init' [-Wmissing-prototypes]
790 | void __init __weak mem_encrypt_init(void) { }
| ^~~~~~~~~~~~~~~~
init/main.c:792:20: warning: no previous prototype for 'poking_init' [-Wmissing-prototypes]
792 | void __init __weak poking_init(void) { }
| ^~~~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/kernel/efi.c:33:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
arch/ia64/kernel/efi.c: In function 'efi_init':
arch/ia64/kernel/efi.c:490:13: warning: variable 'efi_desc_size' set but not used [-Wunused-but-set-variable]
490 | u64 efi_desc_size;
| ^~~~~~~~~~~~~
arch/ia64/kernel/efi.c:489:31: warning: variable 'efi_map_end' set but not used [-Wunused-but-set-variable]
489 | void *efi_map_start, *efi_map_end;
| ^~~~~~~~~~~
arch/ia64/kernel/efi.c: At top level:
arch/ia64/kernel/efi.c:971:1: warning: no previous prototype for 'find_memmap_space' [-Wmissing-prototypes]
971 | find_memmap_space (void)
| ^~~~~~~~~~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/kernel/process.c:30:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
arch/ia64/kernel/process.c:155:1: warning: no previous prototype for 'console_print' [-Wmissing-prototypes]
155 | console_print(const char *s)
| ^~~~~~~~~~~~~
arch/ia64/kernel/process.c:161:1: warning: no previous prototype for 'do_notify_resume_user' [-Wmissing-prototypes]
161 | do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall)
| ^~~~~~~~~~~~~~~~~~~~~
arch/ia64/kernel/process.c:400:17: warning: no previous prototype for 'ia64_clone' [-Wmissing-prototypes]
400 | asmlinkage long ia64_clone(unsigned long clone_flags, unsigned long stack_start,
| ^~~~~~~~~~
arch/ia64/kernel/process.c:557:1: warning: no previous prototype for 'cpu_halt' [-Wmissing-prototypes]
557 | cpu_halt (void)
| ^~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/include/asm/sal.h:41,
from arch/ia64/kernel/sal.c:19:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
arch/ia64/kernel/sal.c:43:29: warning: cast between incompatible function types from 'long int (*)(void)' to 'struct ia64_sal_retval (*)(u64, ...)' {aka 'struct ia64_sal_retval (*)(long long unsigned int, ...)'} [-Wcast-function-type]
43 | ia64_sal_handler ia64_sal = (ia64_sal_handler) default_handler;
| ^
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/include/asm/sal.h:41,
from arch/ia64/kernel/salinfo.c:51:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t arch/ia64/kernel/salinfo.c:212:1: warning: no previous prototype for 'salinfo_log_wakeup' [-Wmissing-prototypes]
212 | salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe)
| ^~~~~~~~~~~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/kernel/setup.c:49:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
arch/ia64/kernel/setup.c:1074:1: warning: no previous prototype for 'check_bugs' [-Wmissing-prototypes]
1074 | check_bugs (void)
| ^~~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/kernel/time.c:22:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
arch/ia64/kernel/time.c:259:6: warning: no previous prototype for 'ia64_init_itm' [-Wmissing-prototypes]
259 | void ia64_init_itm(void)
| ^~~~~~~~~~~~~
arch/ia64/kernel/time.c:396:1: warning: no previous prototype for 'time_init' [-Wmissing-prototypes]
396 | time_init (void)
| ^~~~~~~~~
--
In file included from include/linux/nvmem-provider.h:14,
from include/linux/rtc.h:18,
from include/linux/efi.h:20,
from arch/ia64/include/asm/sal.h:41,
from arch/ia64/kernel/mca.c:98:
>> include/linux/gpio/consumer.h:362:45: error: unknown type name 'hte_ts_threaded'; did you mean 'hte_ts_threaded_cb_t'?
362 | hte_ts_threaded tcb,
| ^~~~~~~~~~~~~~~
| hte_ts_threaded_cb_t
arch/ia64/kernel/mca.c: In function 'ia64_mca_printk':
arch/ia64/kernel/mca.c:212:13: warning: variable 'printed_len' set but not used [-Wunused-but-set-variable]
212 | int printed_len;
| ^~~~~~~~~~~
arch/ia64/kernel/mca.c: At top level:
arch/ia64/kernel/mca.c:505:1: warning: no previous prototype for 'search_mca_table' [-Wmissing-prototypes]
505 | search_mca_table (const struct mca_table_entry *first,
| ^~~~~~~~~~~~~~~~
arch/ia64/kernel/mca.c:608:1: warning: no previous prototype for 'ia64_mca_register_cpev' [-Wmissing-prototypes]
608 | ia64_mca_register_cpev (int cpev)
| ^~~~~~~~~~~~~~~~~~~~~~ arch/ia64/kernel/mca.c:1285:1: warning: no previous prototype for 'ia64_mca_handler' [-Wmissing-prototypes]
1285 | ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
| ^~~~~~~~~~~~~~~~
..
vim +362 include/linux/gpio/consumer.h
334
335
336 static inline int gpiod_get_direction(const struct gpio_desc *desc)
337 {
338 /* GPIO can never have been requested */
339 WARN_ON(desc);
340 return -ENOSYS;
341 }
342 static inline int gpiod_direction_input(struct gpio_desc *desc)
343 {
344 /* GPIO can never have been requested */
345 WARN_ON(desc);
346 return -ENOSYS;
347 }
348 static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
349 {
350 /* GPIO can never have been requested */
351 WARN_ON(desc);
352 return -ENOSYS;
353 }
354 static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
355 {
356 /* GPIO can never have been requested */
357 WARN_ON(desc);
358 return -ENOSYS;
359 }
360 static inline int gpiod_req_hw_timestamp_ns(struct gpio_desc *desc,
361 hte_ts_cb_t cb,
> 362 hte_ts_threaded tcb,
363 void *data)
364 {
365 WARN_ON(desc);
366 return -ENOSYS;
367 }
368 static inline int gpiod_rel_hw_timestamp_ns(struct gpio_desc *desc)
369 {
370 WARN_ON(desc);
371 return -ENOSYS;
372 }
373 static inline int gpiod_get_value(const struct gpio_desc *desc)
374 {
375 /* GPIO can never have been requested */
376 WARN_ON(desc);
377 return 0;
378 }
379 static inline int gpiod_get_array_value(unsigned int array_size,
380 struct gpio_desc **desc_array,
381 struct gpio_array *array_info,
382 unsigned long *value_bitmap)
383 {
384 /* GPIO can never have been requested */
385 WARN_ON(desc_array);
386 return 0;
387 }
388 static inline void gpiod_set_value(struct gpio_desc *desc, int value)
389 {
390 /* GPIO can never have been requested */
391 WARN_ON(desc);
392 }
393 static inline int gpiod_set_array_value(unsigned int array_size,
394 struct gpio_desc **desc_array,
395 struct gpio_array *array_info,
396 unsigned long *value_bitmap)
397 {
398 /* GPIO can never have been requested */
399 WARN_ON(desc_array);
400 return 0;
401 }
402 static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
403 {
404 /* GPIO can never have been requested */
405 WARN_ON(desc);
406 return 0;
407 }
408 static inline int gpiod_get_raw_array_value(unsigned int array_size,
409 struct gpio_desc **desc_array,
410 struct gpio_array *array_info,
411 unsigned long *value_bitmap)
412 {
413 /* GPIO can never have been requested */
414 WARN_ON(desc_array);
415 return 0;
416 }
417 static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
418 {
419 /* GPIO can never have been requested */
420 WARN_ON(desc);
421 }
422 static inline int gpiod_set_raw_array_value(unsigned int array_size,
423 struct gpio_desc **desc_array,
424 struct gpio_array *array_info,
425 unsigned long *value_bitmap) 426 {
427 /* GPIO can never have been requested */
428 WARN_ON(desc_array);
429 return 0;
430 }
431
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [RFC v2 06/11] gpiolib: Add HTE support
In reply to Dipen PatelQuoted 7 lines · Dipen Patel
Some GPIO chip can provide hardware timestamp support on its GPIO lines , in order to support that additional API needs to be added which can talk to both GPIO chip and HTE (hardware timestamping engine) subsystem. This patch introduces APIs which gpio consumer can use to request hardware assisted timestamping. Below is the list of the APIs that are added in gpiolib subsystem.
Quoted 7 lines
-
gpiod_req_hw_timestamp_ns- Request HTE on specified GPIO line.
-gpiod_rel_hw_timestamp_ns- Release HTE functionality on GPIO line.Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- removed get timestamp and is timestamp enabled APIs
Pretty straight forward IMO
Yours,
Linus Walleij
Dipen Patel
maintainerRFC v2 7/11 gpio: tegra186: Add HTE in gpio-tegra186 driver
In reply to Dipen PatelTegra194 AON GPIO controller with the use of its internal hardware timestamping engine (HTE) also known as GTE can timestamp GPIO lines through system counter. This patch implements two callbacks which are essential for the gpio consumers that want such HTE functionality. The callbacks details can be found at include/gpio/driver.h.
Since AON GPIO controller depends on HTE engine, it creates hardware dependency between controller and AON HTE provider. To express that, the optional devicetree property is introduced for AON GPIO controller.
--- .../bindings/gpio/nvidia,tegra186-gpio.txt | 7 ++ drivers/gpio/gpio-tegra186.c | 89 +++++++++++++++++++ 2 files changed, 96 insertions(+)
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt +7 -0
@@ -127,6 +127,12 @@ Required properties: - 8: Active low level-sensitive. Valid combinations are 1, 2, 3, 4, 8. +Optional properties: +- timestamp-engine + AON GPIO controller has timestamp engine which can hardware timestamp + GPIO configured as input and IRQ. This property specifies hardware + timestamp engine (HTE) device-tree node. + Example: #include <dt-bindings/interrupt-controller/irq.h>
@@ -162,4 +168,5 @@ gpio@c2f0000 { #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + timestamp-engine = <&tegra_hte_aon>; };
drivers/gpio/gpio-tegra186.c +89 -0
119 lines not on this page · raw message
Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [RFC v2 07/11] gpio: tegra186: Add HTE in gpio-tegra186 driver
Quoted 7 lines · Dipen Patel
Tegra194 AON GPIO controller with the use of its internal hardware timestamping engine (HTE) also known as GTE can timestamp GPIO lines through system counter. This patch implements two callbacks which are essential for the gpio consumers that want such HTE functionality. The callbacks details can be found at
include/gpio/driver.h.
Quoted 7 lines
Since AON GPIO controller depends on HTE engine, it creates hardware dependency between controller and AON HTE provider. To express that, the optional devicetree property is introduced for AON GPIO controller.
Signed-off-by Dipen Patel <[email protected]>--- .../bindings/gpio/nvidia,tegra186-gpio.txt | 7 ++
Bindings should be a separate patch. Consider converting this to schema first too.
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt Required properties: · line 131
Quoted 13 lines
drivers/gpio/gpio-tegra186.c | 89 +++++++++++++++++++ 2 files changed, 96 insertions(+)Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt +2
-0@@ -127,6 +127,12 @@ Required properties: - 8: Active low level-sensitive. Valid combinations are 1, 2, 3, 4, 8. +Optional properties: +- timestamp-engine
Should be in the common binding.
But then when do you use hardware-timestamps? This property seems to assume GPIO hand the timestamp engine have the same numbering of signals. I think you need to be able to map GPIOx to timestamp y. If you want a short cut for a 1-1 case, then that's another discussion.
Quoted 145 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt +5
-0+ AON GPIO controller has timestamp engine which can hardware timestamp + GPIO configured as input and IRQ. This property specifies hardware + timestamp engine (HTE) device-tree node. + Example: #include <dt-bindings/interrupt-controller/irq.h>@@ -162,4 +168,5 @@ gpio@c2f0000 { #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + timestamp-engine = <&tegra_hte_aon>; };drivers/gpio/gpio-tegra186.c +89
-0@@ -11,6 +11,7 @@#include <linux/module.h> #include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/hte.h> #include <dt-bindings/gpio/tegra186-gpio.h> #include <dt-bindings/gpio/tegra194-gpio.h> @@ -34,6 +35,7 @@#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL BIT(4)#define TEGRA186_GPIO_ENABLE_CONFIG_DEBOUNCE BIT(5)#define TEGRA186_GPIO_ENABLE_CONFIG_INTERRUPT BIT(6) +#define TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC BIT(7)#define TEGRA186_GPIO_DEBOUNCE_CONTROL 0x04#define TEGRA186_GPIO_DEBOUNCE_CONTROL_THRESHOLD (x) ((x) & 0xff)@@ -81,6 +83,7 @@ struct tegra_gpio {struct irq_chip intc;unsigned int num_irq;unsigned int *irq; +struct device *dev;const struct tegra_gpio_soc *soc;unsigned int num_irqs_per_bank;@@ -192,6 +195,86 @@ static int tegra186_gpio_direction_output(struct gpio_chip *chip,return 0 ; } +static int tegra186_gpio_req_hw_ts (struct gpio_chip *chip,unsigned int offset, +hte_ts_cb_t cb,hte_ts_threaded_cb_t tcb, +struct hte_ts_desc *hdesc,void *data) +{ +struct tegra_gpio *gpio; +void __iomem *base; +int value, ret; + +if (!chip || !hdesc) +return -EINVAL ; + + gpio =gpiochip_get_data (chip); +if (!gpio) +return -ENODEV ; + + base =tegra186_gpio_get_base (gpio, offset); +if (WARN_ON (base ==NULL )) +return -EINVAL ; + +/* +* HTE provider of this gpio controller does not support below gpio +* configs: +* 1. gpio as output +* 2. gpio as input +* +* HTE provider supports below gpio config: +* a. gpio as input with irq enabled +*/ + +if (tegra186_gpio_get_direction (chip, offset) == +GPIO_LINE_DIRECTION_OUT ) +return -ENOTSUPP ; + +if (!gpiochip_line_is_irq (chip, offset)) +return -ENOTSUPP ; + + hdesc->con_id = offset; + + ret =hte_req_ts_by_hte_name (gpio->dev,"timestamp-engine" , hdesc, cb, + tcb, data); +if (ret) +return ret; + + value =readl (base +TEGRA186_GPIO_ENABLE_CONFIG ); + value |=TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC ; +writel (value, base +TEGRA186_GPIO_ENABLE_CONFIG ); + +return 0 ; +} + +static int tegra186_gpio_rel_hw_ts (struct gpio_chip *chip, +unsigned int offset, +struct hte_ts_desc *hdesc) +{ +struct tegra_gpio *gpio; +void __iomem *base; +int value, ret; + +if (!hdesc || !chip) +return -EINVAL ; + + gpio =gpiochip_get_data (chip); +if (!gpio) +return -ENODEV ; + + base =tegra186_gpio_get_base (gpio, offset); +if (WARN_ON (base ==NULL )) +return -EINVAL ; + + ret =hte_release_ts (hdesc); +if (ret) +return ret; + + value =readl (base +TEGRA186_GPIO_ENABLE_CONFIG ); + value &= ~TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC ; +writel (value, base +TEGRA186_GPIO_ENABLE_CONFIG ); + +return 0 ; +} +static int tegra186_gpio_get (struct gpio_chip *chip,unsigned int offset) {struct tegra_gpio *gpio =gpiochip_get_data (chip);@@ -821,6 +904,12 @@ static int tegra186_gpio_probe(struct platform_device *pdev) offset += port->pins; } + gpio->dev = &pdev->dev; +if (device_property_present (gpio->dev,"timestamp-engine" )) { + gpio->gpio.req_hw_timestamp = tegra186_gpio_req_hw_ts; + gpio->gpio.rel_hw_timestamp = tegra186_gpio_rel_hw_ts; + } +return devm_gpiochip_add_data (&pdev->dev, &gpio->gpio, gpio); }Signature · 1 line
2.17.1
Dipen Patel
maintainerRe: [RFC v2 07/11] gpio: tegra186: Add HTE in gpio-tegra186 driver
Hi,
Quoted 12 lines · Rob Herring
Quoted 11 lines · Dipen Patel
Tegra194 AON GPIO controller with the use of its internal hardware timestamping engine (HTE) also known as GTE can timestamp GPIO lines through system counter. This patch implements two callbacks which are essential for the gpio consumers that want such HTE functionality. The callbacks details can be found at
include/gpio/driver.h.Since AON GPIO controller depends on HTE engine, it creates hardware dependency between controller and AON HTE provider. To express that, the optional devicetree property is introduced for AON GPIO controller.
Quoted 5 lines
Quoted 3 lines
Signed-off-by Dipen Patel <[email protected]>--- .../bindings/gpio/nvidia,tegra186-gpio.txt | 7 ++Bindings should be a separate patch. Consider converting this to schema first too.
I will create separate patch. For the schema, I guess converting is out of the
scope in this patch series. I believe its better to create separate patch for that
task.
Quoted 11 lines
Quoted 11 lines
drivers/gpio/gpio-tegra186.c | 89 +++++++++++++++++++ 2 files changed, 96 insertions(+)Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt +0
-0@@ -127,6 +127,12 @@ Required properties: - 8: Active low level-sensitive. Valid combinations are 1, 2, 3, 4, 8.
Quoted 8 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt Required properties: · line 131
Quoted 2 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt +2
-0+Optional properties: +- timestamp-engineShould be in the common binding.
But then when do you use hardware-timestamps? This property seems to assume GPIO hand the timestamp engine have the same numbering of signals. I think you need to be able to map GPIOx to timestamp y. If you want a short cut for a 1-1 case, then that's another discussion.
The mapping is done in the GPIO HTE provider if its not one-to-one. An example is
hte-tegra194.c (tegra194_aon_gpio_map) in this patch series.
Quoted 145 lines
Quoted 145 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt +5
-0+ AON GPIO controller has timestamp engine which can hardware timestamp + GPIO configured as input and IRQ. This property specifies hardware + timestamp engine (HTE) device-tree node. + Example: #include <dt-bindings/interrupt-controller/irq.h>@@ -162,4 +168,5 @@ gpio@c2f0000 { #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + timestamp-engine = <&tegra_hte_aon>; };drivers/gpio/gpio-tegra186.c +89
-0@@ -11,6 +11,7 @@#include <linux/module.h> #include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/hte.h> #include <dt-bindings/gpio/tegra186-gpio.h> #include <dt-bindings/gpio/tegra194-gpio.h> @@ -34,6 +35,7 @@#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL BIT(4)#define TEGRA186_GPIO_ENABLE_CONFIG_DEBOUNCE BIT(5)#define TEGRA186_GPIO_ENABLE_CONFIG_INTERRUPT BIT(6) +#define TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC BIT(7)#define TEGRA186_GPIO_DEBOUNCE_CONTROL 0x04#define TEGRA186_GPIO_DEBOUNCE_CONTROL_THRESHOLD (x) ((x) & 0xff)@@ -81,6 +83,7 @@ struct tegra_gpio {struct irq_chip intc;unsigned int num_irq;unsigned int *irq; +struct device *dev;const struct tegra_gpio_soc *soc;unsigned int num_irqs_per_bank;@@ -192,6 +195,86 @@ static int tegra186_gpio_direction_output(struct gpio_chip *chip,return 0 ; } +static int tegra186_gpio_req_hw_ts (struct gpio_chip *chip,unsigned int offset, +hte_ts_cb_t cb,hte_ts_threaded_cb_t tcb, +struct hte_ts_desc *hdesc,void *data) +{ +struct tegra_gpio *gpio; +void __iomem *base; +int value, ret; + +if (!chip || !hdesc) +return -EINVAL ; + + gpio =gpiochip_get_data (chip); +if (!gpio) +return -ENODEV ; + + base =tegra186_gpio_get_base (gpio, offset); +if (WARN_ON (base ==NULL )) +return -EINVAL ; + +/* +* HTE provider of this gpio controller does not support below gpio +* configs: +* 1. gpio as output +* 2. gpio as input +* +* HTE provider supports below gpio config: +* a. gpio as input with irq enabled +*/ + +if (tegra186_gpio_get_direction (chip, offset) == +GPIO_LINE_DIRECTION_OUT ) +return -ENOTSUPP ; + +if (!gpiochip_line_is_irq (chip, offset)) +return -ENOTSUPP ; + + hdesc->con_id = offset; + + ret =hte_req_ts_by_hte_name (gpio->dev,"timestamp-engine" , hdesc, cb, + tcb, data); +if (ret) +return ret; + + value =readl (base +TEGRA186_GPIO_ENABLE_CONFIG ); + value |=TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC ; +writel (value, base +TEGRA186_GPIO_ENABLE_CONFIG ); + +return 0 ; +} + +static int tegra186_gpio_rel_hw_ts (struct gpio_chip *chip, +unsigned int offset, +struct hte_ts_desc *hdesc) +{ +struct tegra_gpio *gpio; +void __iomem *base; +int value, ret; + +if (!hdesc || !chip) +return -EINVAL ; + + gpio =gpiochip_get_data (chip); +if (!gpio) +return -ENODEV ; + + base =tegra186_gpio_get_base (gpio, offset); +if (WARN_ON (base ==NULL )) +return -EINVAL ; + + ret =hte_release_ts (hdesc); +if (ret) +return ret; + + value =readl (base +TEGRA186_GPIO_ENABLE_CONFIG ); + value &= ~TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC ; +writel (value, base +TEGRA186_GPIO_ENABLE_CONFIG ); + +return 0 ; +} +static int tegra186_gpio_get (struct gpio_chip *chip,unsigned int offset) {struct tegra_gpio *gpio =gpiochip_get_data (chip);@@ -821,6 +904,12 @@ static int tegra186_gpio_probe(struct platform_device *pdev) offset += port->pins; } + gpio->dev = &pdev->dev; +if (device_property_present (gpio->dev,"timestamp-engine" )) { + gpio->gpio.req_hw_timestamp = tegra186_gpio_req_hw_ts; + gpio->gpio.rel_hw_timestamp = tegra186_gpio_rel_hw_ts; + } +return devm_gpiochip_add_data (&pdev->dev, &gpio->gpio, gpio); }Signature · 1 line
2.17.1
Dipen Patel
maintainerRFC v2 8/11 gpiolib: cdev: Add hardware timestamp clock type
In reply to Dipen PatelThis patch adds new clock type for the GPIO controller which can timestamp gpio lines in realtime using hardware means. To expose such functionalities to the userspace, code has been added in this patch where during line create call, it checks for new clock type and if requested, calls hardware timestamp related API from gpiolib.c. During line change event, the HTE subsystem pushes timestamp data through callbacks.
---
Changes in v2:
- Added hte_dir and static structure hte_ts_desc.
- Added callbacks which get invoked by HTE when new data is available.
- Better use of hte_dir and seq from hte_ts_desc.
- Modified sw debounce function to accommodate hardware timestamping.
drivers/gpio/gpiolib-cdev.c | 161 ++++++++++++++++++++++++++++++++++-- include/uapi/linux/gpio.h | 1 + 2 files changed, 153 insertions(+), 9 deletions(-)
drivers/gpio/gpiolib-cdev.c +152 -9
@@ -464,6 +464,12 @@ struct line {* stale value. */ unsigned int level; +/* +* dir will be touched in HTE callbacks hte_ts_cb_t and +* hte_ts_threaded_cb_t and they are mutually exclusive. This will be +* unused when HTE is not supported/disabled. +*/ +enum hte_dir dir; };/**
@@ -518,6 +524,7 @@ struct linereq { GPIO_V2_LINE_DRIVE_FLAGS | \ GPIO_V2_LINE_EDGE_FLAGS | \ GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME | \ + GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE | \ GPIO_V2_LINE_BIAS_FLAGS) static void linereq_put_event(struct linereq *lr,
@@ -546,6 +553,94 @@ static u64 line_event_timestamp(struct line *line)return ktime_get_ns (); } +static hte_return_t process_hw_ts_thread (void *p) +{ +struct line *line = p; +struct linereq *lr = line->req; +struct gpio_v2_line_event le; +u64 eflags; + +memset (&le,0 ,sizeof (le)); + + le.timestamp_ns = line->timestamp_ns; + line->timestamp_ns =0 ; + +if (line->dir >=HTE_DIR_NOSUPP ) { + eflags =READ_ONCE (line->eflags); +if (eflags ==GPIO_V2_LINE_FLAG_EDGE_BOTH ) { +int level =gpiod_get_value_cansleep (line->desc); + +if (level) +/* Emit low-to-high event */ + le.id =GPIO_V2_LINE_EVENT_RISING_EDGE ; +else +/* Emit high-to-low event */ + le.id =GPIO_V2_LINE_EVENT_FALLING_EDGE ; + }else if (eflags ==GPIO_V2_LINE_FLAG_EDGE_RISING ) { +/* Emit low-to-high event */ + le.id =GPIO_V2_LINE_EVENT_RISING_EDGE ; + }else if (eflags ==GPIO_V2_LINE_FLAG_EDGE_FALLING ) { +/* Emit high-to-low event */ + le.id =GPIO_V2_LINE_EVENT_FALLING_EDGE ; + }else { +return HTE_CB_ERROR ; + } + }else { +if (line->dir ==HTE_RISING_EDGE_TS ) + le.id =GPIO_V2_LINE_EVENT_RISING_EDGE ; +else + le.id =GPIO_V2_LINE_EVENT_FALLING_EDGE ; + } + + le.line_seqno = line->line_seqno; + le.seqno = (lr->num_lines ==1 ) ? le.line_seqno : line->req_seqno; + le.offset =gpio_chip_hwgpio (line->desc); + +linereq_put_event (lr, &le); + +return HTE_CB_HANDLED ; +} + +static hte_return_t process_hw_ts (struct hte_ts_data *ts,void *p) +{ +struct line *line = p; +struct linereq *lr = line->req; + +if (!ts) +return HTE_CB_ERROR ; + + line->timestamp_ns = ts->tsc; + line->dir = ts->dir; + +/* +* It is possible that HTE engine detects spurious edges for the +* lines where software debounce is enabled. This primary callback +* will be called multiple times in that case. It will be better to +* let debounce_work_func handle instead of process_hw_ts_thread. +* The timestamp_ns will be overwritten here which is fine as we are +* interested in the last value anyway. The debounce_work_func will +* then just read whatever last line->timestamp_ns is stored. Because +* this callback can be called multiple times, we are not really +* interested in ts->seq. +*/ +if (!READ_ONCE (line->sw_debounced)) { + line->line_seqno = ts->seq; + +/* +* Increment in this callback incase all the lines in linereq +* are enabled for hw timestamping. This will work even if +* subset of lines are enabled for hw timestamping as +* edge_irq_* callbacks will proceed as usual for them. +*/ +if (lr->num_lines !=1 ) + line->req_seqno =atomic_inc_return (&lr->seqno); + +return HTE_RUN_THREADED_CB ; + } + +return HTE_CB_HANDLED ; +} +static irqreturn_t edge_irq_thread (int irq,void *p) {struct line *line = p;
@@ -553,6 +648,10 @@ static irqreturn_t edge_irq_thread(int irq, void *p)struct gpio_v2_line_event le;u64 eflags; +/* Let process_hw_ts_thread handle */ +if (test_bit (FLAG_EVENT_CLOCK_HARDWARE , &line->desc->flags)) +return IRQ_HANDLED ; +/* Do not leak kernel stack to userspace */ memset (&le,0 ,sizeof (le));
@@ -604,6 +703,10 @@ static irqreturn_t edge_irq_handler(int irq, void *p)struct line *line = p;struct linereq *lr = line->req; +/* Let HTE supplied callbacks handle */ +if (test_bit (FLAG_EVENT_CLOCK_HARDWARE , &line->desc->flags)) +return IRQ_HANDLED ; +/* * Just store the timestamp in hardirq context so we get it as * close in time as possible to the actual event.
@@ -682,14 +785,6 @@ static void debounce_work_func(struct work_struct *work)/* Do not leak kernel stack to userspace */ memset (&le,0 ,sizeof (le)); - lr = line->req; - le.timestamp_ns =line_event_timestamp (line); - le.offset =gpio_chip_hwgpio (line->desc); - line->line_seqno++; - le.line_seqno = line->line_seqno; - le.seqno = (lr->num_lines ==1 ) ? - le.line_seqno :atomic_inc_return (&lr->seqno); -if (level)/* Emit low-to-high event */ le.id =GPIO_V2_LINE_EVENT_RISING_EDGE ;
@@ -697,6 +792,23 @@ static void debounce_work_func(struct work_struct *work)/* Emit high-to-low event */ le.id =GPIO_V2_LINE_EVENT_FALLING_EDGE ; +if (test_bit (FLAG_EVENT_CLOCK_HARDWARE , &line->desc->flags)) { + le.timestamp_ns = line->timestamp_ns; +if (line->dir <HTE_DIR_NOSUPP ) + le.id = (line->dir ==HTE_RISING_EDGE_TS ) ? +GPIO_V2_LINE_EVENT_RISING_EDGE : +GPIO_V2_LINE_EVENT_FALLING_EDGE ; + }else { + le.timestamp_ns =line_event_timestamp (line); + } + + lr = line->req; + le.offset =gpio_chip_hwgpio (line->desc); + line->line_seqno++; + le.line_seqno = line->line_seqno; + le.seqno = (lr->num_lines ==1 ) ? + le.line_seqno :atomic_inc_return (&lr->seqno); +linereq_put_event (lr, &le); }
@@ -891,7 +1003,6 @@ static int gpio_v2_line_flags_validate(u64 flags)/* Return an error if an unknown flag is set */ if (flags & ~GPIO_V2_LINE_VALID_FLAGS )return -EINVAL ; -/* * Do not allow both INPUT and OUTPUT flags to be set as they are * contradictory.
@@ -900,6 +1011,11 @@ static int gpio_v2_line_flags_validate(u64 flags) (flags & GPIO_V2_LINE_FLAG_OUTPUT))return -EINVAL ; +/* Only allow one event clock source */ +if ((flags &GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME ) && + (flags &GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE )) +return -EINVAL ; +/* Edge detection requires explicit input. */ if ((flags &GPIO_V2_LINE_EDGE_FLAGS ) && !(flags &GPIO_V2_LINE_FLAG_INPUT ))
@@ -992,6 +1108,8 @@ static void gpio_v2_line_config_flags_to_desc_flags(u64 flags,assign_bit (FLAG_EVENT_CLOCK_REALTIME , flagsp, flags &GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME ); +assign_bit (FLAG_EVENT_CLOCK_HARDWARE , flagsp, + flags &GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE ); }static long linereq_get_values (struct linereq *lr,void __user *ip)
@@ -1154,6 +1272,21 @@ static long linereq_set_config_unlocked(struct linereq *lr,return ret; } +/* Check if new config sets hardware assisted clock */ +if (flags &GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE ) { + ret =gpiod_req_hw_timestamp_ns (desc, process_hw_ts, + process_hw_ts_thread, + &lr->lines[i]); +if (ret) +return ret; + }else { +/* +* HTE subsys will do nothing if there is nothing to +* release. +*/ +gpiod_rel_hw_timestamp_ns (desc); + } +blocking_notifier_call_chain (&desc->gdev->notifier,GPIO_V2_LINE_CHANGED_CONFIG , desc);
@@ -1409,6 +1542,14 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip) flags & GPIO_V2_LINE_EDGE_FLAGS);if (ret) goto out_free_linereq; + +if (flags &GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE ) { + ret =gpiod_req_hw_timestamp_ns (desc, process_hw_ts, + process_hw_ts_thread, + &lr->lines[i]); +if (ret) + goto out_free_linereq; + } } blocking_notifier_call_chain(&desc->gdev->notifier,
@@ -1959,6 +2100,8 @@ static void gpio_desc_to_lineinfo(struct gpio_desc *desc,if (test_bit (FLAG_EVENT_CLOCK_REALTIME , &desc->flags)) info->flags |=GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME ; +else if (test_bit (FLAG_EVENT_CLOCK_HARDWARE , &desc->flags)) + info->flags |=GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE ; debounce_period_us =READ_ONCE (desc->debounce_period_us);if (debounce_period_us) {
include/uapi/linux/gpio.h +1 -0
@@ -80,6 +80,7 @@ enum gpio_v2_line_flag {GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN =_BITULL (9 ),GPIO_V2_LINE_FLAG_BIAS_DISABLED =_BITULL (10 ),GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME =_BITULL (11 ), + GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE = _BITULL(12), };/**
Signature · 1 line
2.17.1
Re: [RFC v2 08/11] gpiolib: cdev: Add hardware timestamp clock type
Quoted 8 lines · Dipen Patel
This patch adds new clock type for the GPIO controller which can timestamp gpio lines in realtime using hardware means. To expose such functionalities to the userspace, code has been added in this patch where during line create call, it checks for new clock type and if requested, calls hardware timestamp related API from
gpiolib.c. During line change event, the HTE subsystem pushes timestamp data through callbacks.
Quoted 7 lines
Signed-off-by Dipen Patel <[email protected]>---
Changes in v2:
- Addedhte_dirand static structurehte_ts_desc.
- Added callbacks which get invoked by HTE when new data is available.
- Better use ofhte_dirand seq fromhte_ts_desc.
- Modified sw debounce function to accommodate hardware timestamping.
This looks pretty much like I imagined it would, good work! I am a bit busy now and unable to do an in-depth review (brain parse the code and make sure all is sane) but it looks really good, so at least I can say:
Yours,
Linus Walleij
Re: [RFC v2 08/11] gpiolib: cdev: Add hardware timestamp clock type
In reply to Dipen PatelQuoted 1 line · Dipen Patel
+ if (
test_bit(FLAG_EVENT_CLOCK_HARDWARE, &line->desc->flags)) {
I don't know if it's here or a few other places as well we could sneak in a IS_ENABLED(CONFIG_HTE) to make sure the compiler will optimize out a bunch of the HTE support code if HTE is not in use?
Just an idea, I guess it's not the most urgent.
Yours,
Linus Walleij
Dipen Patel
maintainerRFC v2 9/11 tools: gpio: Add new hardware clock type
In reply to Dipen Patelgpiolib-cdev is extended to support hardware clock type, this patch reflects that fact.
--- tools/gpio/gpio-event-mon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/gpio/gpio-event-mon.c +5 -1
@@ -149,6 +149,7 @@ void print_usage(void)" -r Listen for rising edges\n" " -f Listen for falling edges\n" " -w Report the wall-clock time for events\n" +" -t Report the hardware timestamp for events\n" " -b <n> Debounce the line with period n microseconds\n" " [-c <n>] Do <n> loops (optional, infinite loop if not stated)\n" " -? This helptext\n"
@@ -174,7 +175,7 @@ int main(int argc, char **argv)memset (&config,0 ,sizeof (config)); config.flags =GPIO_V2_LINE_FLAG_INPUT ; -while ((c =getopt (argc, argv,"c:n:o:b:dsrfw?" )) !=-1 ) { +while ((c =getopt (argc, argv,"c:n:o:b:dsrfwt?" )) !=-1 ) {switch (c) {case 'c' : loops =strtoul (optarg,NULL ,10 );
@@ -208,6 +209,9 @@ int main(int argc, char **argv)case 'w' : config.flags |=GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME ;break ; +case 't' : + config.flags |=GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE ; +break ;case '?' :print_usage ();return -1 ;
Signature · 1 line
2.17.1
Re: [RFC v2 09/11] tools: gpio: Add new hardware clock type
Quoted 4 lines · Dipen Patel
gpiolib-cdev is extended to support hardware clock type, this patch reflects that fact.
Signed-off-by Dipen Patel <[email protected]>
Yours,
Linus Walleij
Dipen Patel
maintainerRFC v2 10/11 hte: Add tegra GPIO HTE test driver
In reply to Dipen PatelTegra194 GPIO controller and HTE supports AON GPIO lines for realtime timestamp using hardware means. This in kernel gpio consumer test driver demonstrates that functionality indirectly using HTE subsytem through GPIOLIB framework. During probe it also registers sysfs interface /sys/kernel/tegra_hte_gpio_test/gpio_en_dis. The value 1 enables gpio line for the HTE functionality while the value 0 disables that.
The test driver can be compiled as a module and takes optional parameters gpio_out and gpio_in of type uint that specifies GPIO numbers.
This patch also adds compilation support in Kconfig and Makefile.
--- drivers/hte/Kconfig | 9 + drivers/hte/Makefile | 1 + drivers/hte/hte-tegra194-gpio-test.c | 252 +++++++++++++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 drivers/hte/hte-tegra194-gpio-test.c
drivers/hte/Kconfig +9 -0
@@ -38,4 +38,13 @@ config HTE_TEGRA194_IRQ_TEST The NVIDIA Tegra194 GTE IRQ test driver demonstrates HTE subsystem usage for the LIC IRQ hardware timestamp. +config HTE_TEGRA194_GPIO_TEST + tristate "NVIDIA Tegra194 HTE GPIO Test" + depends on HTE_TEGRA194 + help + The NVIDIA Tegra194 GTE GPIO test driver demonstrates how to use HTE + subsystem indirectly through gpiolib API calls for GPIO line for the + hardware assisted timestamping. + endif +
drivers/hte/Makefile +1 -0
@@ -1,4 +1,5 @@ obj-$(CONFIG_HTE) += hte.o obj-$(CONFIG_HTE_TEGRA194) += hte-tegra194.o obj-$(CONFIG_HTE_TEGRA194_IRQ_TEST) += hte-tegra194-irq-test.o +obj-$(CONFIG_HTE_TEGRA194_GPIO_TEST) += hte-tegra194-gpio-test.o
drivers/hte/hte-tegra194-gpio-test.c new file +252 -0
252 lines not on this page · raw message
Signature · 1 line
2.17.1
Randy Dunlap
reviewerRe: [RFC v2 10/11] hte: Add tegra GPIO HTE test driver
Hi,
drivers/hte/Kconfig config HTE_TEGRA194_IRQ_TEST · line 45
Quoted 13 lines · Dipen Patel
drivers/hte/Kconfig +5
-0@@ -38,4 +38,13 @@ config HTE_TEGRA194_IRQ_TEST The NVIDIA Tegra194 GTE IRQ test driver demonstrates HTE subsystem usage for the LIC IRQ hardware timestamp. +config HTE_TEGRA194_GPIO_TEST + tristate "NVIDIA Tegra194 HTE GPIO Test" + depends on HTE_TEGRA194 + help + The NVIDIA Tegra194 GTE GPIO test driver demonstrates how to use HTE
to use the HTE
drivers/hte/Kconfig config HTE_TEGRA194_IRQ_TEST · line 46
Quoted 1 line
drivers/hte/Kconfig +1
-0+ subsystem indirectly through gpiolib API calls for GPIO line for the
lines
drivers/hte/Kconfig config HTE_TEGRA194_IRQ_TEST · line 47
Quoted 1 line
drivers/hte/Kconfig +1
-0+ hardware assisted timestamping.
hardware-assisted
drivers/hte/Kconfig config HTE_TEGRA194_IRQ_TEST · line 49
Quoted 2 lines
drivers/hte/Kconfig +1
-0+ endif
Also:
Please follow coding-style for Kconfig files:
(from Documentation/process/coding-style.rst, section 10):
For all of the Kconfig* configuration files throughout the source tree, the indentation is somewhat different. Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces.
Some of the lines above are indented with spaces instead of one tab.
thanks.
Signature · 1 line
~Randy
Dipen Patel
maintainerRe: [RFC v2 10/11] hte: Add tegra GPIO HTE test driver
Hi,
Quoted 33 lines · Randy Dunlap
Hi,
Quoted 5 lines · Dipen Patel
drivers/hte/Kconfig +0
-0@@ -38,4 +38,13 @@ config HTE_TEGRA194_IRQ_TESTQuoted 7 lines
The NVIDIA Tegra194 GTE IRQ test driver demonstrates HTE subsystem usage for the LIC IRQ hardware timestamp.
+configHTE_TEGRA194_GPIO_TEST
+ tristate "NVIDIA Tegra194 HTE GPIO Test"
+ depends onHTE_TEGRA194
+ help
+ The NVIDIA Tegra194 GTE GPIO test driver demonstrates how to use HTEto use the HTE
Quoted 1 line
+ subsystem indirectly through gpiolib API calls for GPIO line for the
lines
Quoted 1 line
+ hardware assisted timestamping.
hardware-assisted
Quoted 2 lines
+
endifAlso:
Please follow coding-style for
Kconfigfiles:
Quoted 9 lines
(from
Documentation/process/coding-style.rst, section 10):For all of the Kconfig* configuration files throughout the source tree, the indentation is somewhat different. Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces.
Some of the lines above are indented with spaces instead of one tab.
I will double check this. From the RFCv1 comments, I did correct formatting according
to above coding style i.e. everything 1 tab except help which is 1 tab + 2 spaces.
Quoted 2 lines
thanks.
Dipen Patel
maintainerRFC v2 11/11 MAINTAINERS: Added HTE Subsystem
In reply to Dipen PatelAdded myself as a maintainer for this new Hardware Timestamping Engine (HTE) subsystem.
--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -8659,6 +8659,14 @@ L: [email protected] S: Maintained F: drivers/input/touchscreen/htcpen.c +HTE SUBSYSTEM +M: [email protected] +S: Maintained +F: drivers/hte/* +F: include/linux/hte.h +F: Documentation/hte/* +F: Documentation/devicetree/bindings/hte/* + HTS221 TEMPERATURE-HUMIDITY IIO DRIVER M: Lorenzo Bianconi <[email protected]> L: [email protected]
Signature · 1 line
2.17.1
Randy Dunlap
reviewerRe: [RFC v2 11/11] MAINTAINERS: Added HTE Subsystem
Quoted 13 lines · Dipen Patel
Added myself as a maintainer for this new Hardware Timestamping Engine (HTE) subsystem.
Signed-off-by Dipen Patel <[email protected]>--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)MAINTAINERS +0
-0
MAINTAINERS L: [email protected] · line 8663
Quoted 5 lines
MAINTAINERS +2
-0@@ -8659,6 +8659,14 @@ L: [email protected] S: Maintained F: drivers/input/touchscreen/htcpen.c +HTE SUBSYSTEM +M: [email protected]
Please update as documented:
M: *Mail* patches to: FullName <address@domain>
Quoted 10 lines
MAINTAINERS +6
-0+S: Maintained +F: drivers/hte/* +F: include/linux/hte.h +F: Documentation/hte/* +F: Documentation/devicetree/bindings/hte/* + HTS221 TEMPERATURE-HUMIDITY IIO DRIVER M: Lorenzo Bianconi <[email protected]> L: [email protected]
Signature · 1 line
~Randy
Re: [RFC v2 11/11] MAINTAINERS: Added HTE Subsystem
Quoted 3 lines · Randy Dunlap
Quoted 2 lines · Dipen Patel
Added myself as a maintainer for this new Hardware Timestamping Engine (HTE) subsystem.
[]
Quoted 1 line
MAINTAINERS
Quoted 1 line
MAINTAINERS +0
-0
[]
Quoted 5 lines
MAINTAINERS L: [email protected] · line 8668
Quoted 5 lines
MAINTAINERS +5
-0+S: Maintained +F: drivers/hte/* +F: include/linux/hte.h +F: Documentation/hte/* +F: Documentation/devicetree/bindings/hte/*
And using * does not support any possible subdirectory
Likely these should be:
F: drivers/hte/
F: include/linux/hte.h
F: Documentation/hte/
F: Documentation/devicetree/bindings/hte/