mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jie Gan <jie.gan@oss.qualcomm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>, Leo Yan <leo.yan@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Tingwei Zhang <tingwei.zhang@oss.qualcomm.com>,
	Yuanfang Zhang <yuanfang.zhang@oss.qualcomm.com>
Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] coresight: tnoc: fix trace ID path assignment failure on non-AMBA tnoc
Date: Mon, 9 Nov 2026 09:28:46 +0800	[thread overview]
Message-ID: <a34ea028-77f9-4e01-a7dd-eb4811c97845@oss.qualcomm.com> (raw)
In-Reply-To: <20260902-fix-trace-id-error-in-tnoc-driver-v2-1-73669a947297@oss.qualcomm.com>



On 9/2/2026 5:41 PM, Jie Gan wrote:
> For a tnoc device not on the AMBA bus, atid was set to -EOPNOTSUPP.
> trace_noc_id() returns this value directly to
> coresight_path_assign_trace_id(), which only treats a literal 0
> return as "this device has no ID, keep searching the path" -
> any other value is checked against IS_VALID_CS_TRACE_ID() and
> rejected. A negative atid therefore made path assignment fail with
> -EINVAL instead of falling through to the next device in the path
> that could supply a valid trace ID.
> 
> Use 0, the same sentinel coresight_path_assign_trace_id() already
> recognizes as "not allocated", instead of -EOPNOTSUPP.
> 


Gentle ping


> Fixes: 5799dee92dc2 ("coresight-tnoc: add platform driver to support Interconnect TNOC")
> Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
> ---
> Changes in v2:
> - fixes the issue in TNOC driver instead of in generic framework.
> Link to v1 - https://lore.kernel.org/all/20260817-fix-trace-id-assign-issue-v1-1-b2164e33f9fa@oss.qualcomm.com/
> ---
>   drivers/hwtracing/coresight/coresight-tnoc.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c
> index 9e8de4323d28..8924b61ad076 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 == 0) {
>   		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)
> @@ -166,7 +164,7 @@ static umode_t trace_id_is_visible(struct kobject *kobj,
>   	struct device *dev = kobj_to_dev(kobj);
>   	struct trace_noc_drvdata *drvdata = dev_get_drvdata(dev->parent);
>   
> -	if (attr == &dev_attr_traceid.attr && drvdata->atid < 0)
> +	if (attr == &dev_attr_traceid.attr && drvdata->atid == 0)
>   		return 0;
>   
>   	return attr->mode;
> 
> ---
> base-commit: 8b72f6626dc39b9e7e82b2721d4f7c3b86286012
> change-id: 20260902-fix-trace-id-error-in-tnoc-driver-eda88ea30662
> 
> Best regards,


      parent reply	other threads:[~2026-11-09  1:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  9:41 Jie Gan
2026-09-02  9:52 ` Leo Yan
2026-11-09  1:28 ` Jie Gan [this message]

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=a34ea028-77f9-4e01-a7dd-eb4811c97845@oss.qualcomm.com \
    --to=jie.gan@oss.qualcomm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --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 \
    --cc=tingwei.zhang@oss.qualcomm.com \
    --cc=yuanfang.zhang@oss.qualcomm.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®