Skip to contentSkip to conversation

*** SUBJECT HERE ***

PATCH In review Tao Zhang 3 participants 7 messages Apr 16, 2021

Subsystems (3)
lore
Share & tools
lore

Tao Zhang

author
#0 lore raw

cover *** SUBJECT HERE ***

*** BLURB HERE ***

Tao Zhang (2):
coresight: Add support for device names
dt-bindings: arm: add property for coresight component name

 Documentation/devicetree/bindings/arm/coresight.txt | 2 ++
 drivers/hwtracing/coresight/coresight-core.c        | 6 ++++++
 2 files changed, 8 insertions(+)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
author
#1 lore raw

PATCH 1/2 coresight: Add support for device names

Add support to read device names from device tree entries. Before the previous process of allocating coresight device name, try to read the coresight device name from device tree entries. If it is read, the device name will be returned directly. If it is not read, the original allocation name process will be followed.

---
 drivers/hwtracing/coresight/coresight-core.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/hwtracing/coresight/coresight-core.c +6 -0
index 4ba801d..b79c726 100644
@@ -1640,6 +1640,12 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
 	int idx;
 	char *name = NULL;
 	struct fwnode_handle **list;
+	struct device_node *node = dev->of_node;
+
+	if (!node) {
+		if (!of_property_read_string(node, "coresight-name", &name))
+			return name;
+	}
 
 	mutex_lock(&coresight_mutex);
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw

Re: [PATCH v1 1/2] coresight: Add support for device names

drivers/hwtracing/coresight/coresight-core.c char *coresight_alloc_device_name(struct coresight_dev_list *dict, · line 1646

Quoted 12 lines · Tao Zhang
drivers/hwtracing/coresight/coresight-core.c +4 -0
index 4ba801d..b79c726 100644
@@ -1640,6 +1640,12 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict,
 	int idx;
 	char *name = NULL;
 	struct fwnode_handle **list;
+	struct device_node *node = dev->of_node;
+
+	if (!node) {
+		if (!of_property_read_string(node, "coresight-name", &name))

Ok, I'm not a device tree expert, but I'm pretty sure the above is a nop.

Regards,
--
Alex

#3 lore raw

Re: [PATCH v1 1/2] coresight: Add support for device names

Quoted 19 lines · Alexander Shishkin

drivers/hwtracing/coresight/coresight-core.c char *coresight_alloc_device_name(struct · line 1647

Quoted 13 lines · Tao Zhang
drivers/hwtracing/coresight/coresight-core.c +4 -0
index 4ba801d..b79c726 100644
@@ -1640,6 +1640,12 @@ char *coresight_alloc_device_name(struct 
 coresight_dev_list *dict,
 	int idx;
 	char *name = NULL;
 	struct fwnode_handle **list;
+	struct device_node *node = dev->of_node;
+
+	if (!node) {
+		if (!of_property_read_string(node, "coresight-name", &name))

Ok, I'm not a device tree expert, but I'm pretty sure the above is a nop.

Quoted 3 lines

Regards,
--
Alex

You are right. The pointer check code here is wrong, I will correct it on the V2 version.

Tao

author
#4 lore raw

PATCH 2/2 dt-bindings: arm: add property for coresight component name

In reply to Tao Zhang

Add property "coresight-name" for coresight component name. This allows coresight driver to read device name from device entries.

---
 Documentation/devicetree/bindings/arm/coresight.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/coresight.txt +2 -0
index d711676..0e980ce 100644
@@ -103,6 +103,8 @@ its hardware characteristcs.
 	  powers down the coresight component also powers down and loses its
 	  context. This property is currently only used for the ETM 4.x driver.
 
+	* coresight-name: the name of the coresight devices.
+
 * Optional properties for ETM/PTMs:
 
 	* arm,cp14: must be present if the system accesses ETM/PTM management
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#5 lore raw

Re: [PATCH v1 2/2] dt-bindings: arm: add property for coresight component name

Quoted 13 lines · Tao Zhang

Add property "coresight-name" for coresight component name. This allows coresight driver to read device name from device entries.

---
 Documentation/devicetree/bindings/arm/coresight.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/coresight.txt +0 -0
index d711676..0e980ce 100644

Documentation/devicetree/bindings/arm/coresight.txt its hardware characteristcs. · line 106

Quoted 4 lines
Documentation/devicetree/bindings/arm/coresight.txt +1 -0
@@ -103,6 +103,8 @@ its hardware characteristcs.
 	  powers down the coresight component also powers down and loses its
 	  context. This property is currently only used for the ETM 4.x driver.
 
+	* coresight-name: the name of the coresight devices.

Which devices? Also, is it a common practice to extend device tree definitions based on arbitrary driver needs, or should there be some sort of a discussion first?

Regards,
--
Alex