aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>2023-09-14 22:02:05 +0530
committerReza Arbab <arbab@linux.ibm.com>2023-09-15 12:59:35 -0500
commit33233bcb7054595098dc6171ab9c4e5e2e661857 (patch)
tree88e103f29dca909600134a7518049dd79ffcd900
parentf6434d0961f793836fb06a0434e3608d9ac9ff00 (diff)
downloadskiboot-33233bcb7054595098dc6171ab9c4e5e2e661857.zip
skiboot-33233bcb7054595098dc6171ab9c4e5e2e661857.tar.gz
skiboot-33233bcb7054595098dc6171ab9c4e5e2e661857.tar.bz2
hw/imc: Update IMC code to use dt_find_by_name_before_addr for checking dt nodes
The nest IMC (In Memory Collection) Performance Monitoring Unit(PMU) node names are saved in nest_pmus[] array in the "hw/imc.c" IMC code. Not all the IMC PMUs listed in the device tree may be available. Nest IMC PMU names along with their bit values is represented in imc availability vector. The nest_pmus[] array is used to remove the unavailable nodes by checking this vector. To check node availability, code was using "dt_find_by_substr". But since the node names have format like: "name@offset", dt_find_by_name doesn't return the expected result. Fix this by using dt_find_by_name_before_addr. Also, update the char array to use correct node names. Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
-rw-r--r--hw/imc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/imc.c b/hw/imc.c
index 97e0809..73f25da 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -67,14 +67,14 @@ static char const *nest_pmus[] = {
"mba5",
"mba6",
"mba7",
- "cen0",
- "cen1",
- "cen2",
- "cen3",
- "cen4",
- "cen5",
- "cen6",
- "cen7",
+ "centaur0",
+ "centaur1",
+ "centaur2",
+ "centaur3",
+ "centaur4",
+ "centaur5",
+ "centaur6",
+ "centaur7",
"xlink0",
"xlink1",
"xlink2",
@@ -412,7 +412,7 @@ static void disable_unavailable_units(struct dt_node *dev)
for (i = 0; i < ARRAY_SIZE(nest_pmus); i++) {
if (!(PPC_BITMASK(i, i) & avl_vec)) {
/* Check if the device node exists */
- target = dt_find_by_name(dev, nest_pmus[i]);
+ target = dt_find_by_name_before_addr(dev, nest_pmus[i]);
if (!target)
continue;
/* Remove the device node */