Skip to contentSkip to conversation

perf/arm-cmn: Ensure port and device id bits are set properly

PATCH Applied Namhyung Kim 4 participants 4 messages Nov 21, 2024 – Nov 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf/arm-cmn: Ensure port and device id bits are set properly

The portid_bits and deviceid_bits were set only for XP type nodes in the arm_cmn_discover() and it confused other nodes to find XP nodes. Copy the both bits from the XP nodes directly when it sets up a new node.

Fixes e79634b53e39 ("perf/arm-cmn: Refactor node ID handling. Again.")
---
 drivers/perf/arm-cmn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/arm-cmn.c +2 -2
index 49bd811c6fd6efdd..b20fa600e510c54f 100644
@@ -2178,8 +2178,6 @@ static int arm_cmn_init_dtcs(struct arm_cmn *cmn)
 			continue;
 
 		xp = arm_cmn_node_to_xp(cmn, dn);
-		dn->portid_bits = xp->portid_bits;
-		dn->deviceid_bits = xp->deviceid_bits;
 		dn->dtc = xp->dtc;
 		dn->dtm = xp->dtm;
 		if (cmn->multi_dtm)
@@ -2420,6 +2418,8 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
 			}
 
 			arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn);
+			dn->portid_bits = xp->portid_bits;
+			dn->deviceid_bits = xp->deviceid_bits;
 
 			switch (dn->type) {
 			case CMN_TYPE_DTC:

base-commit: 43fb83c17ba2d63dfb798f0be7453ed55ca3f9c2

Signature · 1 line
2.47.0.338.g60cca15819-goog
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Namhyung Kim

The portid_bits and deviceid_bits were set only for XP type nodes in the arm_cmn_discover() and it confused other nodes to find XP nodes. Copy the both bits from the XP nodes directly when it sets up a new node.

Quoted 30 lines
Fixes e79634b53e39 ("perf/arm-cmn: Refactor node ID handling. Again.")
---
  drivers/perf/arm-cmn.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/arm-cmn.c +2 -2
index 49bd811c6fd6efdd..b20fa600e510c54f 100644
@@ -2178,8 +2178,6 @@ static int arm_cmn_init_dtcs(struct arm_cmn *cmn)
  			continue;
 
  		xp = arm_cmn_node_to_xp(cmn, dn);
-		dn->portid_bits = xp->portid_bits;
-		dn->deviceid_bits = xp->deviceid_bits;
  		dn->dtc = xp->dtc;
  		dn->dtm = xp->dtm;
  		if (cmn->multi_dtm)
@@ -2420,6 +2418,8 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
  			}
 
  			arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn);
+			dn->portid_bits = xp->portid_bits;
+			dn->deviceid_bits = xp->deviceid_bits;
 
  			switch (dn->type) {
  			case CMN_TYPE_DTC:

base-commit: 43fb83c17ba2d63dfb798f0be7453ed55ca3f9c2

maintainer Acked-by on v2 1/1
#2 lore raw
In reply to Namhyung Kim
Quoted 10 lines · Namhyung Kim

The portid_bits and deviceid_bits were set only for XP type nodes in the arm_cmn_discover() and it confused other nodes to find XP nodes. Copy the both bits from the XP nodes directly when it sets up a new node.

Fixes e79634b53e39 ("perf/arm-cmn: Refactor node ID handling. Again.")
---
 drivers/perf/arm-cmn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Catalin -- here's another perf fix for you!

Thanks,

Will

#3 lore raw
In reply to Namhyung Kim
Quoted 6 lines · Namhyung Kim

The portid_bits and deviceid_bits were set only for XP type nodes in the arm_cmn_discover() and it confused other nodes to find XP nodes. Copy the both bits from the XP nodes directly when it sets up a new node.

Applied to arm64 (for-next/fixes), thanks!

[1/1] perf/arm-cmn: Ensure port and device id bits are set properly

      https://git.kernel.org/arm64/c/dfdf714fed55
Signature · 1 line
Catalin