mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinlong Mao <quic_jinlmao@quicinc.com>
To: Mike Leach <mike.leach@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Leo Yan <leo.yan@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	<coresight@lists.linaro.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Tingwei Zhang <quic_tingweiz@quicinc.com>,
	Yuanfang Zhang <quic_yuanfang@quicinc.com>,
	Tao Zhang <quic_taozha@quicinc.com>,
	Trilok Soni <quic_tsoni@quicinc.com>,
	Hao Zhang <quic_hazha@quicinc.com>,
	<linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v3 00/10] Coresight: Add support for TPDM and TPDA
Date: Thu, 17 Feb 2022 17:16:23 +0800	[thread overview]
Message-ID: <ab88b2b2-e44b-e783-3372-d23f56ce24e9@quicinc.com> (raw)
In-Reply-To: <0c87c995-142c-9c8f-5a9a-02e3a1119cce@quicinc.com>

On 2/11/2022 12:17 PM, Jinlong Mao wrote:
>
> On 2/10/2022 6:30 PM, Mike Leach wrote:
>> Hello  Mao,
>>
>> I have looked through this set and have a few general questions.
>>
>> My understanding based on the information in the code is that the TPDM
>> devices will always send data to the TPDA device, the TPDM is not
>> capable of directly driving the ATB itself?
>> The TPDA device  will then packetize the inputs and output these to
>> the ATB over the normal CoreSight architecture to a standard ETR / ETF
>> for collection.
>>
>> Looking at the TPDM driver - it is assigned a trace ID but never
>> actually uses it in the hardware. My assumption here is that this is
>> used purely to satisfy the requirement that the CoreSight core has
>> that all sources have a unique trace id?
>>
>> For the TPDA driver you assign an ATID as an attribute in device tree,
>> and then program this into the devices control register.
>>
>> The trace IDs in ETM / ETE / STM, are programmed into the hardware and
>> these values drive the ATID value on the trace bus. So assigning an
>> ATID value to the TPDA driver through device tree will lead to clashes
>> with the assignment of trace IDs in the other driver software.
>>
>> The topology here appears to me that you have multiple  "data source"
>> devices TPDM, supplying a TPDA - which is the real CoreSight "trace
>> source" from the viewpoint of the trace bus and CoreSight
>> infrastructure.
>> To get this to work in the current CoreSight driver stack, you have
>> assigned the TPDM as a source type, and the TPDA as a link to ensure
>> that when a TPDM is started, all the components on the path to the
>> sink are activated.
>> This is fine.
>>
>> If my assumptions above are all accurate I suggest the following 
>> improvements
>>
>> For TPDA drop the device tree assignment of ATID and instead use the
>> coresight_get_system_trace_id() function you introduce in the 2nd
>> patch in this set.
>>
>> For TPDM you have assigned a unique source sub-type
>> CORESIGHT_DEV_SUBTYPE_SOURCE_SYS.- this could become
>> CORESIGHT_DEV_SUBTYPE_SOURCE_DATA_ONLY. If the trace ID assigned to
>> this device is only to satisfy the unique ID requirement and is not
>> used elsewhere, then the sub type could become
>> CORESIGHT_DEV_SUBTYPE_SOURCE_DATA_ONLY. We can agree that this sub
>> type does not need a unique ID and acts as none ATB a source for
>> another component, The core code can be altered to drop the
>> requirement for this sub-type and trace ID can be dropped for this
>> component.
>>
>> You should be aware that we are in the process of re-designed how
>> trace IDs are allocated. The current mechanism does not scale for
>> large multi-core systems (currently broken for any system > 46 cores),
>> and as you have discovered there is a need for additional allocation
>> of IDs. Also the ETE / TRBE combination does not need a trace ID.  A
>> dynamic allocation system is being proposed.
>>
>> Regards
>>
>> Mike
>
>
> Hi  Mike,
>
> Your assumptions above are all correct.
> TPDMs connect to the same TPDA will share the atid of the TPDA.
> We have a PC tool to parse the TPDM trace data. It needs the fixed 
> atid for each TPDA to identify the data.
> So we configure the atid for TPDA in device tree with fixed ids.
> I will discuss with internal tool team to see if TPDA's id can become 
> dynamic when parse the data.
>
> Apart from the TPDA's atid, we also have some other sources with fixed 
> id in HW on our internal device.
> Do you have any suggestion to how to allocate the IDs for the source 
> with fixed id in HW ?
>
> Thanks
> Jinlong Mao
>
Hi Mike & Mathieu & Suzuki,


Could you please help to review the other patches while we are 
discussing with internal tool team about the trace_id change ?


Thanks

Jinlong Mao


>
>>
>>
>> On Wed, 9 Feb 2022 at 10:57, Mao Jinlong <quic_jinlmao@quicinc.com> 
>> wrote:
>>> This series adds support for the trace performance monitoring and
>>> diagnostics hardware (TPDM and TPDA). It is composed of two major
>>> elements.
>>> a) Changes for original coresight framework to support for TPDM and 
>>> TPDA.
>>> b) Add driver code for TPDM and TPDA.
>>>
>>> Introduction of changes for original coresight framework
>>> Support TPDM as new coresight source.
>>> Since only STM and ETM are supported as coresight source originally.
>>> TPDM is a newly added coresight source. We need to change
>>> the original way of saving coresight path to support more types source
>>> for coresight driver.
>>> The following patch is to add support more coresight sources.
>>>      Use IDR to maintain all the enabled sources' paths.
>>>      coresight: Use bitmap to assign trace id to the sources
>>>
>>> Introduction of TPDM and TPDA
>>> TPDM - The trace performance monitoring and diagnostics monitor or 
>>> TPDM in
>>> short serves as data collection component for various dataset types
>>> specified in the QPMDA(Qualcomm performance monitoring and diagnostics
>>> architecture) spec. The primary use case of the TPDM is to collect data
>>> from different data sources and send it to a TPDA for packetization,
>>> timestamping and funneling.
>>>      Coresight: Add coresight TPDM source driver
>>>      dt-bindings: arm: Adds CoreSight TPDM hardware definitions
>>>      coresight-tpdm: Add DSB dataset support
>>>      coresight-tpdm: Add integration test support
>>>      docs: sysfs: coresight: Add sysfs ABI documentation for TPDM
>>>
>>> TPDA - The trace performance monitoring and diagnostics aggregator or
>>> TPDA in short serves as an arbitration and packetization engine for the
>>> performance monitoring and diagnostics network as specified in the 
>>> QPMDA
>>> (Qualcomm performance monitoring and diagnostics architecture)
>>> specification. The primary use case of the TPDA is to provide
>>> packetization, funneling and timestamping of Monitor data as specified
>>> in the QPMDA specification.
>>> The following patch is to add driver for TPDA.
>>>      Coresight: Add TPDA link driver
>>>      dt-bindings: arm: Adds CoreSight TPDA hardware definitions
>>>
>>> The last patch of this series is a device tree modification, which add
>>> the TPDM and TPDA configuration to device tree for validating.
>>>      ARM: dts: msm: Add coresight components for SM8250
>>>
>>> Once this series patches are applied properly, the tpdm and tpda nodes
>>> should be observed at the coresight path /sys/bus/coresight/devices
>>> e.g.
>>> /sys/bus/coresight/devices # ls -l | grep tpd
>>> tpda0 -> ../../../devices/platform/soc@0/6004000.tpda/tpda0
>>> tpdm0 -> ../../../devices/platform/soc@0/6c08000.mm.tpdm/tpdm0
>>>
>>> We can use the commands are similar to the below to validate TPDMs.
>>> Enable coresight sink first.
>>>
>>> echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
>>> echo 1 > /sys/bus/coresight/devices/tpdm0/enable_source
>>> echo 1 > /sys/bus/coresight/devices/tpdm0/integration_test
>>> echo 2 > /sys/bus/coresight/devices/tpdm0/integration_test
>>> The test data will be collected in the coresight sink which is enabled.
>>> If rwp register of the sink is keeping updating when do
>>> integration_test (by cat tmc_etf0/mgmt/rwp), it means there is data
>>> generated from TPDM to sink.
>>>
>>> Changes from V2:
>>> 1. Use bitmap to assign the trace id. (Mathieu Poirier)
>>>
>>> Mao Jinlong (10):
>>>    Use IDR to maintain all the enabled sources' paths.
>>>    coresight: Use bitmap to assign trace id to the sources
>>>    Coresight: Add coresight TPDM source driver
>>>    dt-bindings: arm: Adds CoreSight TPDM hardware definitions
>>>    coresight-tpdm: Add DSB dataset support
>>>    coresight-tpdm: Add integration test support
>>>    docs: sysfs: coresight: Add sysfs ABI documentation for TPDM
>>>    Coresight: Add TPDA link driver
>>>    dt-bindings: arm: Adds CoreSight TPDA hardware definitions
>>>    ARM: dts: msm: Add coresight components for SM8250
>>>
>>>   .../testing/sysfs-bus-coresight-devices-tpdm  |   6 +
>>>   .../bindings/arm/coresight-tpda.yaml          | 129 ++++
>>>   .../bindings/arm/coresight-tpdm.yaml          |  81 ++
>>>   .../devicetree/bindings/arm/coresight.txt     |   7 +
>>>   MAINTAINERS                                   |   1 +
>>>   .../arm64/boot/dts/qcom/sm8250-coresight.dtsi | 690 
>>> ++++++++++++++++++
>>>   arch/arm64/boot/dts/qcom/sm8250.dtsi          |   2 +
>>>   drivers/hwtracing/coresight/Kconfig           |  33 +
>>>   drivers/hwtracing/coresight/Makefile          |   2 +
>>>   drivers/hwtracing/coresight/coresight-core.c  | 127 ++--
>>>   drivers/hwtracing/coresight/coresight-tpda.c  | 193 +++++
>>>   drivers/hwtracing/coresight/coresight-tpda.h  |  32 +
>>>   drivers/hwtracing/coresight/coresight-tpdm.c  | 270 +++++++
>>>   drivers/hwtracing/coresight/coresight-tpdm.h  |  57 ++
>>>   include/linux/coresight-pmu.h                 |  11 +
>>>   include/linux/coresight.h                     |   1 +
>>>   16 files changed, 1592 insertions(+), 50 deletions(-)
>>>   create mode 100644 
>>> Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm
>>>   create mode 100644 
>>> Documentation/devicetree/bindings/arm/coresight-tpda.yaml
>>>   create mode 100644 
>>> Documentation/devicetree/bindings/arm/coresight-tpdm.yaml
>>>   create mode 100644 arch/arm64/boot/dts/qcom/sm8250-coresight.dtsi
>>>   create mode 100644 drivers/hwtracing/coresight/coresight-tpda.c
>>>   create mode 100644 drivers/hwtracing/coresight/coresight-tpda.h
>>>   create mode 100644 drivers/hwtracing/coresight/coresight-tpdm.c
>>>   create mode 100644 drivers/hwtracing/coresight/coresight-tpdm.h
>>>
>>> -- 
>>> 2.17.1
>>>
>>
>> -- 
>> Mike Leach
>> Principal Engineer, ARM Ltd.
>> Manchester Design Centre. UK

  reply	other threads:[~2022-02-17  9:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 10:56 Mao Jinlong
2022-02-09 10:56 ` [PATCH v3 01/10] Use IDR to maintain all the enabled sources' paths Mao Jinlong
2022-02-09 15:34   ` Mike Leach
2022-02-09 10:56 ` [PATCH v3 02/10] coresight: Use bitmap to assign trace id to the sources Mao Jinlong
2022-02-17 17:35   ` Mike Leach
2022-02-09 10:56 ` [PATCH v3 03/10] Coresight: Add coresight TPDM source driver Mao Jinlong
2022-02-18 16:10   ` Mike Leach
2022-02-09 10:57 ` [PATCH v3 04/10] dt-bindings: arm: Adds CoreSight TPDM hardware definitions Mao Jinlong
2022-02-17 17:48   ` Mike Leach
2022-02-09 10:57 ` [PATCH v3 05/10] coresight-tpdm: Add DSB dataset support Mao Jinlong
2022-02-18 16:10   ` Mike Leach
2022-02-09 10:57 ` [PATCH v3 06/10] coresight-tpdm: Add integration test support Mao Jinlong
2022-02-09 10:57 ` [PATCH v3 07/10] docs: sysfs: coresight: Add sysfs ABI documentation for TPDM Mao Jinlong
2022-02-09 10:57 ` [PATCH v3 08/10] Coresight: Add TPDA link driver Mao Jinlong
2022-02-09 10:57 ` [PATCH v3 09/10] dt-bindings: arm: Adds CoreSight TPDA hardware definitions Mao Jinlong
2022-02-09 10:57 ` [PATCH v3 10/10] ARM: dts: msm: Add coresight components for SM8250 Mao Jinlong
2022-02-18 16:10   ` Mike Leach
2022-02-10 10:30 ` [PATCH v3 00/10] Coresight: Add support for TPDM and TPDA Mike Leach
2022-02-11  4:17   ` Jinlong Mao
2022-02-17  9:16     ` Jinlong Mao [this message]
2022-02-17 15:30     ` Mike Leach
2022-02-28  2:49       ` Jinlong Mao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab88b2b2-e44b-e783-3372-d23f56ce24e9@quicinc.com \
    --to=quic_jinlmao@quicinc.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=quic_hazha@quicinc.com \
    --cc=quic_taozha@quicinc.com \
    --cc=quic_tingweiz@quicinc.com \
    --cc=quic_tsoni@quicinc.com \
    --cc=quic_yuanfang@quicinc.com \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®