Thread (91 messages) flat view 91 messages, 9 authors, 2021-02-22

Re: [PATCH V3 02/14] coresight: Do not scan for graph if none is present

From: Mike Leach <hidden>
Date: 2021-02-02 11:11:45
Also in: lkml

Hi Ansuman,

On Wed, 27 Jan 2021 at 08:55, Anshuman Khandual
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Suzuki K Poulose <suzuki.poulose@arm.com>

If a graph node is not found for a given node, of_get_next_endpoint()
will emit the following error message :

 OF: graph: no port node found in /<node_name>

If the given component doesn't have any explicit connections (e.g,
ETE) we could simply ignore the graph parsing.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <redacted>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Anshuman Khandual <redacted>
---
 drivers/hwtracing/coresight/coresight-platform.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 3629b78..c594f45 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -90,6 +90,12 @@ static void of_coresight_get_ports_legacy(const struct device_node *node,
        struct of_endpoint endpoint;
        int in = 0, out = 0;

+       /*
+        * Avoid warnings in of_graph_get_next_endpoint()
+        * if the device doesn't have any graph connections
+        */
+       if (!of_graph_is_present(node))
+         return;
The problem here is that you are masking genuine errors.
The solution is to either call this only if the device type is one
that ports are not required - i.e. ETE, or upgrade the .dts bindings
for the rest of the ETM devices to yaml so that the ports requirement
is checked and validated there.

Regards

Mike
        do {
                ep = of_graph_get_next_endpoint(node, ep);
                if (!ep)
--
2.7.4

-- 
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help