public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Yuanfang Zhang <quic_yuanfang@quicinc.com>, Leo Yan <leo.yan@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>,
	James Clark <james.clark@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	kernel@oss.qualcomm.com, linux-arm-msm@vger.kernel.org,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] coresight: add coresight Trace Network On Chip driver
Date: Fri, 30 May 2025 12:32:23 +0100	[thread overview]
Message-ID: <17abf8b5-8a2e-4573-a870-e2f98ad866a6@arm.com> (raw)
In-Reply-To: <62d1e4cb-cc13-4333-a160-66a280dca5f6@quicinc.com>

On 30/05/2025 11:28, Yuanfang Zhang wrote:
> 
> 
> On 5/27/2025 6:19 PM, Suzuki K Poulose wrote:
>> On 23/05/2025 09:56, Leo Yan wrote:
>>> On Fri, May 23, 2025 at 04:08:58PM +0800, Yuanfang Zhang wrote:
>>>
>>> [...]
>>>
>>>>>> +static int trace_noc_init_default_data(struct trace_noc_drvdata *drvdata)
>>>>>> +{
>>>>>> +    int atid;
>>>>>> +
>>>>>> +    atid = coresight_trace_id_get_system_id();
>>>>>> +    if (atid < 0)
>>>>>> +        return atid;
>>>>>> +
>>>>>> +    drvdata->atid = atid;
>>>>>
>>>>> Do you need to expose this via sysfs ? Otherwise, how can you map
>>>>> a trace to a TNOC at decoding ?
>>>>
>>>> yes, need to expose the atid via sysfs, but it better to expose it on source driver which connect with
>>>> this TNOC. so dont expose it on this driver.
>>
>> But why ? How does that work ? The packets that come via TNOC (irrespective of the source(s)) will have the same ATID as that of the TNOC. So :
>>
>> 1) How does it help if the source exports the ID that was allocated in the TNOC driver ?
>>
> The sources connecting to TNOC will have the same ATID which allocate in TNOC.
> This is convenient as users do not need to know which source is connected to this TNOC,
> to get ID can through reading the trace_id sysfs node in the source directory.
> 
>> 2) How does the source driver know the TraceID for exposing via sysfs ?
>> Does it expose its own traceid ?
> No, sources connecting to TNOC don't have their own traceid, it expose the ATID which allocated in TNOC.
> TNOC will maintain the ID in coresight_path:: trace_id, when enable source, the source can get it from path.
> 
> Here is the patch to expose id in source:
> https://patchwork.kernel.org/project/linux-arm-kernel/patch/20250530-showtraceid-v1-1-2761352cf7b4@quicinc.com/

Please don't do that. We don't have to fake a traceid for all sources.
It is only of use to the decoder, with manual input from the user. So,
someone using the TNOC based system must be aware of how to collect the
traceid and as such expose it from the TNOC and not all the other
sources connected to it.

Simply expose it on the TNOC device node


Suzuki


>>
>>>
>>> If so, why the ID is not maintained in coresight_path::trace_id?
>>>
>>> A source device allocates ID and maintains in coresight path, then
>>> this ID is passed (when enabling the link) to TNOC driver to consume it.
>>
> This is because there can be multiple sources connected to one TNOC, and these sources share one Trace ID, so the ID is allocated in TNOC.
> 
>> Good question, since we have the "path" maintaining the TraceID, we
>> should use that here for the TNOC. But the other question is, can there be multiple sources connected to a single TNOC ? (I am guessing, yes!. And thus it may not work with what you are proposing.
>>
>   
> yes, there can be multiple sources connected to one TNOC, and these sources share one Trace ID which allocate in TNOC.
> To decode the scenario relay on TraceID + Inport number, TraceID identifies the TNOC, the decoder maintains a table that maps each TNOC inport to its corresponding source.
> 
>> Cheers
>> Suzuki
>>
>>
>>>
>>> Thanks,
>>> Leo
>>
>>
>>
> 


  reply	other threads:[~2025-05-30 11:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22  8:07 [PATCH v6 0/2] coresight: Add Coresight Trace Network On Chip driver Yuanfang Zhang
2025-05-22  8:07 ` [PATCH v6 1/2] dt-bindings: arm: Add device Trace Network On Chip definition Yuanfang Zhang
2025-05-22  8:07 ` [PATCH v6 2/2] coresight: add coresight Trace Network On Chip driver Yuanfang Zhang
2025-05-22 13:05   ` Leo Yan
2025-05-23  8:37     ` Yuanfang Zhang
2025-05-22 13:13   ` Suzuki K Poulose
2025-05-23  8:08     ` Yuanfang Zhang
2025-05-23  8:56       ` Leo Yan
2025-05-27 10:19         ` Suzuki K Poulose
2025-05-30 10:28           ` Yuanfang Zhang
2025-05-30 11:32             ` Suzuki K Poulose [this message]
2025-05-30 12:59               ` Leo Yan
2025-06-03  3:22                 ` Yuanfang Zhang
2025-06-03 12:25                   ` Leo Yan
2025-06-06  9:20                     ` Yuanfang Zhang

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=17abf8b5-8a2e-4573-a870-e2f98ad866a6@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=conor+dt@kernel.org \
    --cc=coresight@lists.linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.clark@linaro.org \
    --cc=kernel@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=quic_yuanfang@quicinc.com \
    --cc=robh@kernel.org \
    /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