From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13272C48BF6 for ; Thu, 29 Feb 2024 15:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hThbHwHKPsJXAQzEViYp1GOp5ehDemSdm10NS/zg5B0=; b=V/yVgMpzJmQPIV 61biCq6RXCmirRbGDsWI2gMspCiBozWeHkCiHlU3Qpd3oQnwAFlPOJRNljnanPTT0pcchlXE/Saum qXZvpzO38EeJV1/pCdQWdFKZrPLkIZV6WMwHOzsDk+S+7eyCDcx5Z4tXLf5l5lKiGaPibCrgfZzGj QeGxDLfdK0knLqG1CH4cl/bvy0r8m2fkkGEK35Vf8rxWfkiqWrgEmN7rxp4ybBP3DE6m7nlAbyPM4 ivNlOUtEdKjEyzbJ3iP4VNh/u7rn65zwxAYc5Y/j+EZdzcILL5Pe6bMSJ2tgH1roDBmYEAt1DJang +KIYH0d91qPjvEapY59Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfig4-0000000E7xK-2YLE; Thu, 29 Feb 2024 15:50:32 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfifZ-0000000E7ac-2Lli for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 15:50:03 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E1D91601FF; Thu, 29 Feb 2024 15:50:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A34FBC43390; Thu, 29 Feb 2024 15:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709221800; bh=/UDMCO+p3pTN0o3VKH882mj3piAL34bvPIkXm2pXWnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=is480fk7cNTOODF8vlmOac4m59R67O76roWs/+/tZpeFGsfJ27BAp+WYPSIpn59Kx IWn0RkJFchZLocXALvn9ApAvGzeGHW4e5p5ZTLAYGAUiId9Iiyjjcy3maoy1tO/aEw DFqtnF1LXPYxpAIWHLo+NybPL2e1Ld2Hv5CKAFpLfLDMtJ2seAzvsFlSx+dUxC0wLU LtiHsshyazfti9nnjf06LTnl4smSp71J5sXAhYtdKrM6uB24W5hcWnfAPOjWruzWAy l91PoUccSAXRDtWoUqv8D1XzFmc+0weVikZ7ta6RuyozJgqR9dJzdiztf1mkfqlssM uSkjCVJF54dHg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ilkka Koskinen , Robin Murphy , Will Deacon , Sasha Levin , mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.6 07/21] perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count) Date: Thu, 29 Feb 2024 10:49:27 -0500 Message-ID: <20240229154946.2850012-7-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229154946.2850012-1-sashal@kernel.org> References: <20240229154946.2850012-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.18 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_075001_873671_DB41FD42 X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ilkka Koskinen [ Upstream commit 50572064ec7109b00eef8880e905f55861c8b3de ] 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 Link: https://lore.kernel.org/r/ce4b1442135fe03d0de41859b04b268c88c854a3.1707498577.git.robin.murphy@arm.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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 6404b17d3aeb0..2c684e49a6fc7 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -2301,6 +2301,17 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned 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 == 0 && cmn->part != PART_CMN600) { + dev_dbg(cmn->dev, "bogus child pointer?\n"); + continue; + } arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn); -- 2.43.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel