mbox series

[v3,0/3] coresight: Add preferred trace id support

Message ID 20240626060724.28862-1-quic_jinlmao@quicinc.com (mailing list archive)
Headers show
Series coresight: Add preferred trace id support | expand

Message

Mao Jinlong June 26, 2024, 6:07 a.m. UTC
Some HW has static trace id which cannot be changed via
software programming. For this case, configure the trace id
in device tree with "arm,trace-id = <xxx>", and
call coresight_trace_id_get_system_id with the trace id value
in device probe function. The id will be reserved for the HW
all the time if the device is probed.

Changes since V2:
1. Change "trace-id" to "arm,trace-id".
2. Add trace id flag for getting preferred id or ODD id.

Changes since V1:
1. Add argument to coresight_trace_id_get_system_id for preferred id
instead of adding new function coresight_trace_id_reserve_system_id.
2. Add constraint to trace-id in dt-binding file.

Mao Jinlong (3):
  dt-bindings: arm: Add arm,trace-id for coresight dummy source
  coresight: Add support to get preferred id for system trace sources
  coresight: dummy: Add reserve atid support for dummy source

 .../sysfs-bus-coresight-devices-dummy-source  | 15 +++++
 .../arm/arm,coresight-dummy-source.yaml       |  6 ++
 drivers/hwtracing/coresight/coresight-dummy.c | 59 +++++++++++++++++--
 .../hwtracing/coresight/coresight-platform.c  | 25 ++++++++
 drivers/hwtracing/coresight/coresight-stm.c   |  2 +-
 drivers/hwtracing/coresight/coresight-tpda.c  |  2 +-
 .../hwtracing/coresight/coresight-trace-id.c  | 35 +++++++----
 .../hwtracing/coresight/coresight-trace-id.h  | 11 +++-
 include/linux/coresight.h                     |  1 +
 9 files changed, 137 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source

Comments

Mike Leach July 18, 2024, 3:57 p.m. UTC | #1
Hi,

I have detailed comments in the following patches but in summary we should:
1) consistently use the term "static trace id" for these devices where
the hardware sets a non-programmable trace ID
2) Simplify the patch set by introducing a new API function
int coresight_trace_id_get_system_static_id(int trace_id)
This would avoid having to change drivers which use the existing
function where no static ID is required.

Regards

Mike


On Wed, 26 Jun 2024 at 07:07, Mao Jinlong <quic_jinlmao@quicinc.com> wrote:
>
> Some HW has static trace id which cannot be changed via
> software programming. For this case, configure the trace id
> in device tree with "arm,trace-id = <xxx>", and
> call coresight_trace_id_get_system_id with the trace id value
> in device probe function. The id will be reserved for the HW
> all the time if the device is probed.
>
> Changes since V2:
> 1. Change "trace-id" to "arm,trace-id".
> 2. Add trace id flag for getting preferred id or ODD id.
>
> Changes since V1:
> 1. Add argument to coresight_trace_id_get_system_id for preferred id
> instead of adding new function coresight_trace_id_reserve_system_id.
> 2. Add constraint to trace-id in dt-binding file.
>
> Mao Jinlong (3):
>   dt-bindings: arm: Add arm,trace-id for coresight dummy source
>   coresight: Add support to get preferred id for system trace sources
>   coresight: dummy: Add reserve atid support for dummy source
>
>  .../sysfs-bus-coresight-devices-dummy-source  | 15 +++++
>  .../arm/arm,coresight-dummy-source.yaml       |  6 ++
>  drivers/hwtracing/coresight/coresight-dummy.c | 59 +++++++++++++++++--
>  .../hwtracing/coresight/coresight-platform.c  | 25 ++++++++
>  drivers/hwtracing/coresight/coresight-stm.c   |  2 +-
>  drivers/hwtracing/coresight/coresight-tpda.c  |  2 +-
>  .../hwtracing/coresight/coresight-trace-id.c  | 35 +++++++----
>  .../hwtracing/coresight/coresight-trace-id.h  | 11 +++-
>  include/linux/coresight.h                     |  1 +
>  9 files changed, 137 insertions(+), 19 deletions(-)
>  create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source
>
> --
> 2.41.0
>


--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
Mao Jinlong July 22, 2024, 10:34 a.m. UTC | #2
On 2024/7/18 23:57, Mike Leach wrote:
> Hi,
> 
> I have detailed comments in the following patches but in summary we should:
> 1) consistently use the term "static trace id" for these devices where
> the hardware sets a non-programmable trace ID
> 2) Simplify the patch set by introducing a new API function
> int coresight_trace_id_get_system_static_id(int trace_id)
> This would avoid having to change drivers which use the existing
> function where no static ID is required.
> 

Thanks for the comments, Mike.
I will address your comments in next version.

Thanks
Jinlong Mao

> Regards
> 
> Mike
> 
> 
> On Wed, 26 Jun 2024 at 07:07, Mao Jinlong <quic_jinlmao@quicinc.com> wrote:
>>
>> Some HW has static trace id which cannot be changed via
>> software programming. For this case, configure the trace id
>> in device tree with "arm,trace-id = <xxx>", and
>> call coresight_trace_id_get_system_id with the trace id value
>> in device probe function. The id will be reserved for the HW
>> all the time if the device is probed.
>>
>> Changes since V2:
>> 1. Change "trace-id" to "arm,trace-id".
>> 2. Add trace id flag for getting preferred id or ODD id.
>>
>> Changes since V1:
>> 1. Add argument to coresight_trace_id_get_system_id for preferred id
>> instead of adding new function coresight_trace_id_reserve_system_id.
>> 2. Add constraint to trace-id in dt-binding file.
>>
>> Mao Jinlong (3):
>>    dt-bindings: arm: Add arm,trace-id for coresight dummy source
>>    coresight: Add support to get preferred id for system trace sources
>>    coresight: dummy: Add reserve atid support for dummy source
>>
>>   .../sysfs-bus-coresight-devices-dummy-source  | 15 +++++
>>   .../arm/arm,coresight-dummy-source.yaml       |  6 ++
>>   drivers/hwtracing/coresight/coresight-dummy.c | 59 +++++++++++++++++--
>>   .../hwtracing/coresight/coresight-platform.c  | 25 ++++++++
>>   drivers/hwtracing/coresight/coresight-stm.c   |  2 +-
>>   drivers/hwtracing/coresight/coresight-tpda.c  |  2 +-
>>   .../hwtracing/coresight/coresight-trace-id.c  | 35 +++++++----
>>   .../hwtracing/coresight/coresight-trace-id.h  | 11 +++-
>>   include/linux/coresight.h                     |  1 +
>>   9 files changed, 137 insertions(+), 19 deletions(-)
>>   create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source
>>
>> --
>> 2.41.0
>>
> 
> 
> --
> Mike Leach
> Principal Engineer, ARM Ltd.
> Manchester Design Centre. UK