From nobody Sat Feb 7 07:12:06 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BC274D112 for ; Fri, 9 Feb 2024 17:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498682; cv=none; b=L7qHpyR7mam6i+bGMsP/8PLArlK0Okx7zghmxFC58InNq6oLV0IpxLZMomrJChH6W4Mt6NmiPpk1X8zemQlJCKUzbdUy7kX6nm+UPFoi7c8HWj70twLXxIukpdAPcYg5ZQjfp9AJheFMp2gPl6ytSLClQCvh4h4wLc1mnbHRUQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498682; c=relaxed/simple; bh=2ubGVaizyiqtk+gGQol1RLvxzIDmXy1/p9toUpaKFdA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=dFpr0/eDOm50KArXlnjAi1W1GEo/EPiu3Oj7hELOs3URvZqFxPzjXORST/2WnlnxjkknhRQePqXO56XdhFNpx2bd7iFTCzP8/dHiqk+3Kqzd0hSu0D4zp9gHoJNkYenT3t5UmuUkyXMpBQq7TjB5bE1WtUq+B28GjCReeEuTyPc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D2EB7DA7; Fri, 9 Feb 2024 09:12:01 -0800 (PST) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 145513F64C; Fri, 9 Feb 2024 09:11:18 -0800 (PST) From: Robin Murphy To: will@kernel.org Cc: mark.rutland@arm.com, ilkka@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count) Date: Fri, 9 Feb 2024 17:11:09 +0000 Message-Id: X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ilkka Koskinen 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 [ rm: rewrote simpler generalised version ] Tested-by: Ilkka Koskinen Signed-off-by: Robin Murphy --- drivers/perf/arm-cmn.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index c584165b13ba..7e3aa7e2345f 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -2305,6 +2305,17 @@ static int arm_cmn_discover(struct arm_cmn *cmn, uns= igned int rgn_offset) dev_dbg(cmn->dev, "ignoring external node %llx\n", reg); continue; } + /* + * AmpereOneX erratum AC04_MESH_1 makes some XPs report a bogus + * child count larger than the number of valid child pointers. + * A child offset of 0 can only occur on CMN-600; otherwise it + * would imply the root node being its own grandchild, which + * we can safely dismiss in general. + */ + if (reg =3D=3D 0 && cmn->part !=3D PART_CMN600) { + dev_dbg(cmn->dev, "bogus child pointer?\n"); + continue; + } =20 arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn); =20 --=20 2.39.2.101.g768bb238c484.dirty