Thread (6 messages) flat view 6 messages, 2 authors, 22d ago

Re: [PATCH] coresight: fix trace ID search skipping pass-through NoC devices

From: Leo Yan <leo.yan@arm.com>
Date: 2026-09-02 08:22:12
Also in: lkml
Subsystem: arm/coresight framework and drivers, hardware tracing facilities, the rest · Maintainers: Suzuki K Poulose, Alexander Shishkin, Linus Torvalds

Hi Jie,

On Mon, Aug 17, 2026 at 04:50:15PM +0800, Jie Gan wrote:

[...]
quoted hunk ↗ jump to hunk
@@ -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.

---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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help