Skip to content

coresight: Separate sysfs and Perf usage and some other cleanups

James Clark linux-arm-kernel lkml 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 1 replyApplied
  2. v18 patches 13 repliesSuperseded

Changes in v2 from the cover letter

* Clarify further "the selected sink" in _coresight_build_path()
* Move etm4x's mode to coresight device which was missing from V1
* Use explicit initialisers in coresight_dev_type
* Create functions for handling mode changes

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/12coresight: Fix issue where a source device's helpers aren't disableddrivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-etm-perf.c drivers/hwtracing/coresight/coresight-priv.h+25 -90 replies
2/12coresight: Make language around "activated" sinks consistentdrivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-priv.h include/linux/coresight.h+27 -400 replies
3/12coresight: Remove ops callback checksdrivers/hwtracing/coresight/coresight-core.c+12 -390 replies
4/12coresight: Move mode to struct coresight_devicedrivers/hwtracing/coresight/coresight-etb10.c drivers/hwtracing/coresight/coresight-etm.h drivers/hwtracing/coresight/coresight-etm3x-core.c +11 more+69 -760 replies
5/12coresight: Remove the 'enable' field.drivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-tpda.c include/linux/coresight.h+38 -620 replies
6/12coresight: Move all sysfs code to sysfs filedrivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-etm3x-core.c drivers/hwtracing/coresight/coresight-etm4x-core.c +4 more+407 -4020 replies
7/12coresight: Remove atomic type from refcntdrivers/hwtracing/coresight/coresight-etb10.c drivers/hwtracing/coresight/coresight-sysfs.c drivers/hwtracing/coresight/coresight-tmc-etf.c +5 more+59 -350 replies
8/12coresight: Remove unused stubsinclude/linux/coresight.h+0 -790 replies
9/12coresight: Add explicit member initializers to coresight_dev_typedrivers/hwtracing/coresight/coresight-sysfs.c+5 -50 replies
10/12coresight: Add helper for atomically taking the devicedrivers/hwtracing/coresight/coresight-etm3x-core.c drivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-stm.c +1 more+20 -150 replies
11/12coresight: Add a helper for getting csdev->modedrivers/hwtracing/coresight/coresight-etb10.c drivers/hwtracing/coresight/coresight-etm3x-core.c drivers/hwtracing/coresight/coresight-etm3x-sysfs.c +8 more+50 -450 replies
12/12coresight: Add helper for setting csdev->modedrivers/hwtracing/coresight/coresight-etb10.c drivers/hwtracing/coresight/coresight-etm3x-core.c drivers/hwtracing/coresight/coresight-etm4x-core.c +5 more+35 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/12] coresight: Separate sysfs and Perf usage and some other cleanups

Changes since V1:

* Clarify further "the selected sink" in _coresight_build_path()
* Move etm4x's mode to coresight device which was missing from V1
* Use explicit initialisers in coresight_dev_type
* Create functions for handling mode changes

I've been finding it quite difficult to reason about some of the state and functions in coresight-core.c because they have generic names when they are actually only relevant to the sysfs usage of Coresight rather than usage through Perf. This is probably because sysfs came first and Perf was added later. This has caused a couple of issues where these things have been used in the wrong context, for example the first commit is a fixup.

To fix this I've mainly just moved all of the sysfs stuff to the sysfs file and removed the 'enable' state, which was just for sysfs. While doing the refactor it became obvious that refcnt didn't need to be atomic either, so that can be simplified along with some other comment clarifications and simplifications.

Hopefully it's also a step towards to removing all of the duplicate refcnt and mode tracking code from the individual devices. That tracking pretty much always results in a one-shot enable/disable and fixes the mode to either sysfs or Perf, and there is no reason that can't exist in the core layer outside of the devices. I tried to finish that in this set, but there turned out to be some complexities, so I cut it short at a point where I can be sure that there are no behavioral changes.

James Clark (12):
coresight: Fix issue where a source device's helpers aren't disabled
coresight: Make language around "activated" sinks consistent
coresight: Remove ops callback checks
coresight: Move mode to struct coresight_device
coresight: Remove the 'enable' field.
coresight: Move all sysfs code to sysfs file
coresight: Remove atomic type from refcnt
coresight: Remove unused stubs
coresight: Add explicit member initializers to coresight_dev_type
coresight: Add helper for atomically taking the device
coresight: Add a helper for getting csdev->mode
coresight: Add helper for setting csdev->mode

 drivers/hwtracing/coresight/coresight-core.c  | 494 +-----------------
 drivers/hwtracing/coresight/coresight-etb10.c |  29 +-
 .../hwtracing/coresight/coresight-etm-perf.c  |   2 +-
 drivers/hwtracing/coresight/coresight-etm.h   |   2 -
 .../coresight/coresight-etm3x-core.c          |  23 +-
 .../coresight/coresight-etm3x-sysfs.c         |   4 +-
 .../coresight/coresight-etm4x-core.c          |  26 +-
 drivers/hwtracing/coresight/coresight-etm4x.h |   1 -
 drivers/hwtracing/coresight/coresight-priv.h  |   9 +-
 drivers/hwtracing/coresight/coresight-stm.c   |  30 +-
 drivers/hwtracing/coresight/coresight-sysfs.c | 391 ++++++++++++++
 .../hwtracing/coresight/coresight-tmc-core.c  |   2 +-
 .../hwtracing/coresight/coresight-tmc-etf.c   |  46 +-
 .../hwtracing/coresight/coresight-tmc-etr.c   |  33 +-
 drivers/hwtracing/coresight/coresight-tmc.h   |   2 -
 drivers/hwtracing/coresight/coresight-tpda.c  |  13 +-
 drivers/hwtracing/coresight/coresight-tpiu.c  |  14 +-
 drivers/hwtracing/coresight/ultrasoc-smb.c    |  22 +-
 drivers/hwtracing/coresight/ultrasoc-smb.h    |   2 -
 include/linux/coresight.h                     | 146 ++----
 20 files changed, 606 insertions(+), 685 deletions(-)
Signature · 1 line
2.34.1