Skip to content

Commit 56e14a2

Browse files
Tao ZhangSuzuki K Poulose
authored andcommitted
coresight-tpda: Optimize the function of reading element size
Since the new funnel device supports multi-port output scenarios, there may be more than one TPDM connected to one TPDA. In this way, when reading the element size of the TPDM, TPDA driver needs to find the expected TPDM corresponding to the filter source. When TPDA finds a TPDM or a filter source from a input connection, it will read the Devicetree to get the expected TPDM's element size. Signed-off-by: Tao Zhang <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ec9903d commit 56e14a2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/hwtracing/coresight/coresight-tpda.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ static int tpda_get_element_size(struct tpda_drvdata *drvdata,
110110
csdev->pdata->in_conns[i]->dest_port != inport)
111111
continue;
112112

113+
/*
114+
* If this port has a hardcoded filter, use the source
115+
* device directly.
116+
*/
117+
if (csdev->pdata->in_conns[i]->filter_src_fwnode) {
118+
in = csdev->pdata->in_conns[i]->filter_src_dev;
119+
if (!in)
120+
continue;
121+
}
122+
113123
if (coresight_device_is_tpdm(in)) {
114124
if (drvdata->dsb_esize || drvdata->cmb_esize)
115125
return -EEXIST;
@@ -124,7 +134,6 @@ static int tpda_get_element_size(struct tpda_drvdata *drvdata,
124134
}
125135
}
126136

127-
128137
return rc;
129138
}
130139

0 commit comments

Comments
 (0)