Skip to content

Commit 5057206

Browse files
ilkka-koskinenwilldeacon
authored andcommitted
perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count)
AmpereOneX mesh implementation has a bug in HN-P nodes that makes them report incorrect child count. The failing crosspoints report 8 children while they only have two. When the driver tries to access the inexistent child nodes, it believes it has reached an invalid node type and probing fails. The workaround is to ignore those incorrect child nodes and continue normally. Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> [ rm: rewrote simpler generalised version ] Tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/ce4b1442135fe03d0de41859b04b268c88c854a3.1707498577.git.robin.murphy@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent f9daab0 commit 5057206

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/perf/arm-cmn.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,6 +2305,17 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
23052305
dev_dbg(cmn->dev, "ignoring external node %llx\n", reg);
23062306
continue;
23072307
}
2308+
/*
2309+
* AmpereOneX erratum AC04_MESH_1 makes some XPs report a bogus
2310+
* child count larger than the number of valid child pointers.
2311+
* A child offset of 0 can only occur on CMN-600; otherwise it
2312+
* would imply the root node being its own grandchild, which
2313+
* we can safely dismiss in general.
2314+
*/
2315+
if (reg == 0 && cmn->part != PART_CMN600) {
2316+
dev_dbg(cmn->dev, "bogus child pointer?\n");
2317+
continue;
2318+
}
23082319

23092320
arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn);
23102321

0 commit comments

Comments
 (0)