[PATCH v3 0/1] coresight: fix issue with insufficient claim tags

Mike Leach posted 1 patch 1 day, 11 hours ago
drivers/hwtracing/coresight/coresight-catu.c  |   6 +-
drivers/hwtracing/coresight/coresight-core.c  | 139 ++++++++++++++++--
.../hwtracing/coresight/coresight-cti-core.c  |   7 +-
drivers/hwtracing/coresight/coresight-etb10.c |   9 +-
.../coresight/coresight-etm3x-core.c          |   8 +-
.../coresight/coresight-etm4x-core.c          |   8 +-
.../hwtracing/coresight/coresight-funnel.c    |   7 +-
drivers/hwtracing/coresight/coresight-priv.h  |   7 +
.../coresight/coresight-replicator.c          |   9 +-
.../hwtracing/coresight/coresight-tmc-core.c  |   7 +-
include/linux/coresight.h                     |  23 ++-
11 files changed, 205 insertions(+), 25 deletions(-)
[PATCH v3 0/1] coresight: fix issue with insufficient claim tags
Posted by Mike Leach 1 day, 11 hours ago
All CoreSight compliant components have an implementation defined number
of 0 to 8 claim tag bits in the claim tag registers.

These are used to claim the CoreSight resources by system agents.

ARM recommends implementions have 4 claim tag bits, though a valid
implementation can have 0 claim tags bits.

The CoreSight drivers implement a 2 claim tag bit protocol to allow
self hosted and external debug agents to manage access to the hardware.

However, if there are less than 2 claim tags available the protocol
incorrectly returns an error on device claim, as no checks are made.

If insufficient claim tags are present in a component then the protocol
must return success on claim / disclaim to allow components to be used
normally.

Add initialisation to read the CLAIMSET bits to establish the number of
available claim tag bits, and adjust the claim returns accordingly.

Cache the claimtag protocol availablity in the coresight_device to reduce
reads for the main claim/disclaim api.

changes since v2:
1) consolidated API to remove the API calls using just cs_access, which were
used purely to clear down stale self claim tags, replace with a normal
coresight_device API for initialisation, to match the claim/disclaim API.
This does both the check on availability and the stale tag clearance.
Updated all drivers to use the new init functionality

2) Added option for drivers to skip claim tag checking completely for devices
with no-compliant hardware, that do not implement registers at the claim tag
location, or do not operate correctly to indicate the correct number of
claim tags for the device.

changes since v1:
1) Added claim tag availability cache into coresight_device when using the
main coresight_claim_device() / coresight_disclaim_device() API.

Applies to coresight/next

Mike Leach (1):
  coresight: fix issue where coresight component has no claimtags

 drivers/hwtracing/coresight/coresight-catu.c  |   6 +-
 drivers/hwtracing/coresight/coresight-core.c  | 139 ++++++++++++++++--
 .../hwtracing/coresight/coresight-cti-core.c  |   7 +-
 drivers/hwtracing/coresight/coresight-etb10.c |   9 +-
 .../coresight/coresight-etm3x-core.c          |   8 +-
 .../coresight/coresight-etm4x-core.c          |   8 +-
 .../hwtracing/coresight/coresight-funnel.c    |   7 +-
 drivers/hwtracing/coresight/coresight-priv.h  |   7 +
 .../coresight/coresight-replicator.c          |   9 +-
 .../hwtracing/coresight/coresight-tmc-core.c  |   7 +-
 include/linux/coresight.h                     |  23 ++-
 11 files changed, 205 insertions(+), 25 deletions(-)

-- 
2.43.0