mbox series

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

Message ID 20240129154050.569566-1-james.clark@arm.com (mailing list archive)
Headers show
Series coresight: Separate sysfs and Perf usage and some other cleanups | expand

Message

James Clark Jan. 29, 2024, 3:40 p.m. UTC
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(-)

Comments

Suzuki K Poulose Feb. 12, 2024, 11:27 a.m. UTC | #1
On Mon, 29 Jan 2024 15:40:31 +0000, James Clark wrote:
> 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
> 
> [...]

Applied, thanks!

[01/12] coresight: Fix issue where a source device's helpers aren't disabled
        https://git.kernel.org/coresight/c/f68bbe4dcfa3
[02/12] coresight: Make language around "activated" sinks consistent
        https://git.kernel.org/coresight/c/a0fef3f05cf3
[03/12] coresight: Remove ops callback checks
        https://git.kernel.org/coresight/c/a11ebe138b8d
[04/12] coresight: Move mode to struct coresight_device
        https://git.kernel.org/coresight/c/9cae77cf23e3
[05/12] coresight: Remove the 'enable' field.
        https://git.kernel.org/coresight/c/d5e83f97eb56
[06/12] coresight: Move all sysfs code to sysfs file
        https://git.kernel.org/coresight/c/1f5149c7751c
[07/12] coresight: Remove atomic type from refcnt
        https://git.kernel.org/coresight/c/4545b38ef004
[08/12] coresight: Remove unused stubs
        https://git.kernel.org/coresight/c/053ad9ad1d13
[09/12] coresight: Add explicit member initializers to coresight_dev_type
        https://git.kernel.org/coresight/c/812265e26ed3
[10/12] coresight: Add helper for atomically taking the device
        https://git.kernel.org/coresight/c/d724f65218b9
[11/12] coresight: Add a helper for getting csdev->mode
        https://git.kernel.org/coresight/c/c95c2733e5fe
[12/12] coresight: Add helper for setting csdev->mode
        https://git.kernel.org/coresight/c/bcaabb95f0c9

Best regards,