Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jie Gan <jie.gan@oss.qualcomm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Richard Cheng <icheng@nvidia.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coresight: fix trace ID search skipping pass-through NoC devices
Date: Wed, 2 Sep 2026 16:35:11 +0800	[thread overview]
Message-ID: <28d5c8bf-87b1-4172-94a8-0e1b7ba1f083@oss.qualcomm.com> (raw)
In-Reply-To: <20260902082209.GT8904@e132581.arm.com>



On 9/2/2026 4:22 PM, Leo Yan wrote:
> Hi Jie,
> 
> On Mon, Aug 17, 2026 at 04:50:15PM +0800, Jie Gan wrote:
> 
> [...]
> 
>> @@ -953,8 +953,12 @@ int coresight_path_assign_trace_id(struct coresight_path *path,
>>   		/* Assign a trace ID to the path for the first device that wants to do it */
>>   		trace_id = coresight_get_trace_id(nd->csdev, mode, sink);
>>   
>> -		/* 0 means the device has no ID assignment, so keep searching */
>> -		if (trace_id == 0)
>> +		/*
>> +		 * 0 means the device has no ID assignment, and -EOPNOTSUPP
>> +		 * means the device explicitly declines to assign one (e.g. a
>> +		 * pass-through NoC) - in both cases keep searching downstream.
>> +		 */
>> +		if (trace_id == 0 || trace_id == -EOPNOTSUPP)
>>   			continue;
> 
> Based on IS_VALID_CS_TRACE_ID(), I see 0 is for no ID assignment,
> could you improve a bit tnoc.c instead?
> 
> If so, We don't need to add a new error for the same purpose.
> 

Hi Leo,

Thanks for the suggestion.

I will fix this in the TNOC driver. I agree that there is no need to use 
additional error codes to report the failure.

I will post the new fix patch after below patch[1] to be applied to 
avoid conflict.

[1] 
https://lore.kernel.org/all/20260710-fix-tracenoc-probe-issue-v6-2-41eb36fef8d9@oss.qualcomm.com/

Thanks,
Jie

> ---8<---
> 
> diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c
> index 9e8de4323d28..bf221c1e5c48 100644
> --- a/drivers/hwtracing/coresight/coresight-tnoc.c
> +++ b/drivers/hwtracing/coresight/coresight-tnoc.c
> @@ -51,8 +51,8 @@ static void trace_noc_enable_hw(struct trace_noc_drvdata *drvdata)
>   {
>          u32 val;
> 
> -       /* No valid ATID, simply enable the unit */
> -       if (drvdata->atid == -EOPNOTSUPP) {
> +       /* 0 means no ID assignment, simply enable the unit */
> +       if (!drvdata->atid) {
>                  writel(TRACE_NOC_CTRL_PORTEN, drvdata->base + TRACE_NOC_CTRL);
>                  return;
>          }
> @@ -130,10 +130,8 @@ static int trace_noc_init_default_data(struct trace_noc_drvdata *drvdata)
>   {
>          int atid;
> 
> -       if (!dev_is_amba(drvdata->dev)) {
> -               drvdata->atid = -EOPNOTSUPP;
> +       if (!dev_is_amba(drvdata->dev))
>                  return 0;
> -       }
> 
>          atid = coresight_trace_id_get_system_id();
>          if (atid < 0)



  reply	other threads:[~2026-09-02  8:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  8:50 [PATCH] coresight: fix trace ID search skipping pass-through NoC devices Jie Gan
2026-09-02  6:00 ` Jie Gan
2026-09-02  8:22 ` Leo Yan
2026-09-02  8:35   ` Jie Gan [this message]
2026-09-02  8:45     ` Leo Yan
2026-09-02  8:52       ` Jie Gan

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=28d5c8bf-87b1-4172-94a8-0e1b7ba1f083@oss.qualcomm.com \
    --to=jie.gan@oss.qualcomm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=icheng@nvidia.com \
    --cc=james.clark@linaro.org \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@arm.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