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 registers.
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.
Changes read the CLAIMSET bits to establish the number of available tags, 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 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-core.c | 46 ++++++++++++++++++-- drivers/hwtracing/coresight/coresight-priv.h | 10 +++++ include/linux/coresight.h | 15 +++++++ 3 files changed, 68 insertions(+), 3 deletions(-)