Skip to content

Introduce Intel Trace Hub support

Alexander Shishkin linux-api lkml 4 versions – In review

Get series with b4
b4 am 1442926040-15150-1-git-send-email-alexander.shishkin@linux.intel.com

Versions newest first · linked by author and title

  1. v4 Latest11 patches 1 replyIn review
  2. v311 patches 22 repliesSuperseded
  3. v211 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v111 patches7 repliesSuperseded

Changes in v4 from the cover letter

* Added Mathieu's reviewed-bys.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11stm class: Introduce an abstraction for System Trace Module devicesDocumentation/ABI/testing/configfs-stp-policy Documentation/ABI/testing/sysfs-class-stm Documentation/ABI/testing/sysfs-class-stm_source +11 more+1991 -01 reply
2/11MAINTAINERS: add an entry for System Trace Module device classMAINTAINERS+8 -00 replies
3/11stm class: dummy_stm: Add dummy driver for testing stm classdrivers/hwtracing/stm/Kconfig drivers/hwtracing/stm/Makefile drivers/hwtracing/stm/dummy_stm.c+76 -00 replies
4/11stm class: stm_console: Add kernel-console-over-stm driverdrivers/hwtracing/stm/Kconfig drivers/hwtracing/stm/Makefile drivers/hwtracing/stm/console.c+93 -00 replies
5/11intel_th: Add driver infrastructure for Intel(R) Trace Hub devicesDocumentation/ABI/testing/sysfs-bus-intel_th-output-devices Documentation/trace/intel_th.txt drivers/Kconfig +7 more+1148 -00 replies
6/11intel_th: Add pci glue layer for Intel(R) Trace Hubdrivers/hwtracing/intel_th/Kconfig drivers/hwtracing/intel_th/Makefile drivers/hwtracing/intel_th/pci.c+98 -00 replies
7/11intel_th: Add Global Trace Hub driverDocumentation/ABI/testing/sysfs-bus-intel_th-devices-gth drivers/hwtracing/intel_th/Kconfig drivers/hwtracing/intel_th/Makefile +2 more+834 -00 replies
8/11intel_th: Add Software Trace Hub driverdrivers/hwtracing/intel_th/Kconfig drivers/hwtracing/intel_th/Makefile drivers/hwtracing/intel_th/sth.c +1 more+314 -00 replies
9/11intel_th: Add Memory Storage Unit driverDocumentation/ABI/testing/sysfs-bus-intel_th-devices-msc drivers/hwtracing/intel_th/Kconfig drivers/hwtracing/intel_th/Makefile +2 more+1671 -00 replies
10/11intel_th: Add PTI output driverDocumentation/ABI/testing/sysfs-bus-intel_th-devices-pti drivers/hwtracing/intel_th/Kconfig drivers/hwtracing/intel_th/Makefile +2 more+317 -00 replies
11/11MAINTAINERS: add an entry for Intel(R) Trace HubMAINTAINERS+6 -00 replies

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by.

PatchMathieu Poirier
1/11R-b
2/11
3/11R-b
4/11R-b
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/11] Introduce Intel Trace Hub support

Hi Greg and everybody,

Here's a patchset adding support for Intel Trace Hub (TH) [1] to the kernel. Full description follows the changelog. I took some time discussing matters with Mathieu wrt our common needs from the STM driver framework and also to fix things that I found in the process, so the changelog is a bit hefty. A lot of Intel Trace Hub driver fixes were contributed by Laurent Fert.

Changes since v3:
* Added Mathieu's reviewed-bys.

Changes since v2:
* STM framework changes:
- Addressed Greg KH's comments (struct device usage, attributes, etc etc),
- Started using STM device name in the policy name to make interface more logical,
- Tried to improve initcall ordering to accomodate coresight modules (we might need more work on that when the time comes),
- Fixed output assignment on unlinking,
- Refcounting and locking fixes in stm vs stm_source code,
- Added missing cleanup_srcu_struct() in exit call,
- Changed stm_data::ioctl() to a more specific set_options() callback, which is what the underlying driver actually wants,
- Allocated our ioctl commands "by the book" throught ioctl-number.txt,
- Made stm_data::link() callback return an error code in case the driver doesn't like something; handle this condition accordingly;
* STM console module got renamed to "stm_console";
* Intel TH: fixed resource printing;
* Intel TH/GTH:
- Added an output attribute to control maintenance packet
frequency: smcfreq,
- Undo master assignment on master disabling (Laurent),
- Disable global destination overriding (Laurent),
- Clear force capture done bit on trace disabling (Laurent),
- Fixed handling of masters above 256;
* Intel TH/MSU:
- Reworked block iteration in multiblock mode (Laurent),
- Use pgprot_noncached() for user mappings,
- Fixed window's page offset based on previous window's offset and size (Laurent),
- Fixed user_count when no buffer is allocated (Laurent),
- Reset hw headers in multiblock mode (Laurent);
* Intel TH/STH:
- Handle failure to register stm device.

Changes since v1:

* fixed Kconfig whitespaces and removed defaults per comments from Paul Bolle,
* addressed comments from Joe Perches.

Changes since v0:

* filter-branch'ed everything under drivers/hwtracing where Mathieu is also moving coresight drivers,
* added some more comments to the stm class code to address Mathieu's questions,
* fixed CONFIG_STM=m case, which failed to build in the previous version as pointed out by Paul Bolle,
* fixed a rather embarrassing memory leak in the error path of stm_char_policy_set_ioctl(),
* added ioctl() callback to struct stm_data so that downstream stm drivers can serve their own commands on top of the same file descriptor, as suggested by Mathieu.

Intel Trace Hub (TH) is a set of hardware blocks that produce, switch and output trace data from multiple hardware and software sources over several types of trace output ports encoded in System Trace Protocol (MIPI STPv2) and is intended to perform full system debugging.

The first part of this patchset introduces an abstraction for STM devices, or the devices that combine trace data from multiple trace sources into a STP trace stream. It provides a generic interface for software writers to send their trace data and also solves the problem of mapping STP master/channel asignments to trace sources between the system under tracing and the STP decoder on the debug host end. This part is also useful for the Coresight STM driver as it uses a similar interface and has the same channel mapping problem.

The remainder of the patchset is Intel TH support. The core part is platform independant and is called into by glue layers such as the pci driver that follows. The core provides a bus, on which Intel TH subdevices are allocated. Each subdevice has its own driver. Subdevices are divided into 3 types: sources, outputs and a switch (there's usually just one). The latter is the central component in this scheme of things and is required for other drivers to load and function. Other drivers, however, are optional. Sources are producers of trace data. Outputs are means of exporting the resulting STP trace to the debug host via trace ports or system memory.

All configuration is done via sysfs and doesn't require any specific userspace beyond a shell.

Currently supported Intel TH subdevices are Software Trace Hub (STH, source), Memory Storage Unit (MSU, output), Parallel Tracing Interface unit (PTI, output), Global Trace Hub (GTH, switch). Support for other subdevices can be added later.

Also this patchset adds MAINTAINERS entries for stm class and Intel TH code.

[1] https://software.intel.com/sites/default/files/managed/d3/3c/intel-th-developer-manual.pdf

Alexander Shishkin (11):
stm class: Introduce an abstraction for System Trace Module devices
MAINTAINERS: add an entry for System Trace Module device class stm class: dummy_stm: Add dummy driver for testing stm class stm class: stm_console: Add kernel-console-over-stm driver
intel_th: Add driver infrastructure for Intel(R) Trace Hub devices
intel_th: Add pci glue layer for Intel(R) Trace Hub
intel_th: Add Global Trace Hub driver
intel_th: Add Software Trace Hub driver
intel_th: Add Memory Storage Unit driver
intel_th: Add PTI output driver
MAINTAINERS: add an entry for Intel(R) Trace Hub

 Documentation/ABI/testing/configfs-stp-policy      |   48 +
 .../ABI/testing/sysfs-bus-intel_th-devices-gth     |   49 +
 .../ABI/testing/sysfs-bus-intel_th-devices-msc     |   33 +
 .../ABI/testing/sysfs-bus-intel_th-devices-pti     |   24 +
 .../ABI/testing/sysfs-bus-intel_th-output-devices  |   13 +
 Documentation/ABI/testing/sysfs-class-stm          |   14 +
 Documentation/ABI/testing/sysfs-class-stm_source   |   11 +
 Documentation/ioctl/ioctl-number.txt               |    3 +
 Documentation/trace/intel_th.txt                   |   99 ++
 Documentation/trace/stm.txt                        |   80 ++
 MAINTAINERS                                        |   14 +
 drivers/Kconfig                                    |    4 +
 drivers/Makefile                                   |    2 +
 drivers/hwtracing/intel_th/Kconfig                 |   72 +
 drivers/hwtracing/intel_th/Makefile                |   18 +
 drivers/hwtracing/intel_th/core.c                  |  692 +++++++++
 drivers/hwtracing/intel_th/debug.c                 |   36 +
 drivers/hwtracing/intel_th/debug.h                 |   34 +
 drivers/hwtracing/intel_th/gth.c                   |  706 +++++++++
 drivers/hwtracing/intel_th/gth.h                   |   66 +
 drivers/hwtracing/intel_th/intel_th.h              |  244 ++++
 drivers/hwtracing/intel_th/msu.c                   | 1509 ++++++++++++++++++++
 drivers/hwtracing/intel_th/msu.h                   |  116 ++
 drivers/hwtracing/intel_th/pci.c                   |   86 ++
 drivers/hwtracing/intel_th/pti.c                   |  252 ++++
 drivers/hwtracing/intel_th/pti.h                   |   29 +
 drivers/hwtracing/intel_th/sth.c                   |  259 ++++
 drivers/hwtracing/intel_th/sth.h                   |   42 +
 drivers/hwtracing/stm/Kconfig                      |   25 +
 drivers/hwtracing/stm/Makefile                     |    9 +
 drivers/hwtracing/stm/console.c                    |   80 ++
 drivers/hwtracing/stm/core.c                       | 1029 +++++++++++++
 drivers/hwtracing/stm/dummy_stm.c                  |   66 +
 drivers/hwtracing/stm/policy.c                     |  529 +++++++
 drivers/hwtracing/stm/stm.h                        |   87 ++
 include/linux/stm.h                                |  126 ++
 include/uapi/linux/stm.h                           |   50 +
 37 files changed, 6556 insertions(+)
 create mode 100644 Documentation/ABI/testing/configfs-stp-policy
 create mode 100644 Documentation/ABI/testing/sysfs-bus-intel_th-devices-gth
 create mode 100644 Documentation/ABI/testing/sysfs-bus-intel_th-devices-msc
 create mode 100644 Documentation/ABI/testing/sysfs-bus-intel_th-devices-pti
 create mode 100644 Documentation/ABI/testing/sysfs-bus-intel_th-output-devices
 create mode 100644 Documentation/ABI/testing/sysfs-class-stm
 create mode 100644 Documentation/ABI/testing/sysfs-class-stm_source
 create mode 100644 Documentation/trace/intel_th.txt
 create mode 100644 Documentation/trace/stm.txt
 create mode 100644 drivers/hwtracing/intel_th/Kconfig
 create mode 100644 drivers/hwtracing/intel_th/Makefile
 create mode 100644 drivers/hwtracing/intel_th/core.c
 create mode 100644 drivers/hwtracing/intel_th/debug.c
 create mode 100644 drivers/hwtracing/intel_th/debug.h
 create mode 100644 drivers/hwtracing/intel_th/gth.c
 create mode 100644 drivers/hwtracing/intel_th/gth.h
 create mode 100644 drivers/hwtracing/intel_th/intel_th.h
 create mode 100644 drivers/hwtracing/intel_th/msu.c
 create mode 100644 drivers/hwtracing/intel_th/msu.h
 create mode 100644 drivers/hwtracing/intel_th/pci.c
 create mode 100644 drivers/hwtracing/intel_th/pti.c
 create mode 100644 drivers/hwtracing/intel_th/pti.h
 create mode 100644 drivers/hwtracing/intel_th/sth.c
 create mode 100644 drivers/hwtracing/intel_th/sth.h
 create mode 100644 drivers/hwtracing/stm/Kconfig
 create mode 100644 drivers/hwtracing/stm/Makefile
 create mode 100644 drivers/hwtracing/stm/console.c
 create mode 100644 drivers/hwtracing/stm/core.c
 create mode 100644 drivers/hwtracing/stm/dummy_stm.c
 create mode 100644 drivers/hwtracing/stm/policy.c
 create mode 100644 drivers/hwtracing/stm/stm.h
 create mode 100644 include/linux/stm.h
 create mode 100644 include/uapi/linux/stm.h
Signature · 1 line
2.5.1