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 98820C54E49 for ; Thu, 29 Feb 2024 15:49:35 +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=QbM2ULHdJwJZ3cN2IeOdSztTgkxHbHsUEMrVAhdvoH8=; b=pqEXlg6tHwmAuZ ktlb8Qz02tEJvwx9OLa/UEhN3QiJfuBDoyUueFcWoinPXDQmCYbXUJM0HkAkvDlvDPYxhPiOdaAoQ NzRXjH6bzxnUKJcsGJiYG6AvPGaxUlMk7e3DUqpTZbTic9DsSD34yxnQetqJigFjJmSUEyOX50HKI IoKKhEyZSGj0jjuesb/Cai43vZPaZb+iJTI5kzFOmPBftKhgo9Q2yk+Cr3HJLit4CgztdfYd1SBA8 GuBg+2UGmn/y9QegpKCrJIxKPpmTIDougwSVRK8nteF31QSi/mfyWXi5O84DMwtOY3dkPKUWKQ5L9 OQlJJOf618m6Z0hVdqDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfiev-0000000E7EK-44Kb; Thu, 29 Feb 2024 15:49:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfiei-0000000E76d-14u8 for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 15:49:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9E969611DC; Thu, 29 Feb 2024 15:49:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62BF3C433B2; Thu, 29 Feb 2024 15:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709221747; bh=5F7XSSCngd7SJiSXtRGZSco15qRwSXu6/QNItN9LrzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hh0jzMTPDNE26Siqsw72UEzCT1KFlMBO++UDzbPTNiCq3cCyveUddsn7iYfBPe9mF Krhig8htSj0gYLO1bRzRSOVFqdD4BIgG5ILM7Hk+kkAx3c9EAhTrklRFXtpXUbzZhe fwY1XHiyEPW3Lz1+Dw9G1ZpQvrWbP74gM/C3A0C4CsH7aB1G4tcxuID2YKJ56gKZI+ otqU4abAs6izLVAIic0SvrvFNEVlrzniNQQgdXZTA05/myM/pQVHm7KS5WIMChpW2Z PjDaptjCgWuGSYr0OcWEAxtjMU1yoeJcOlkp3TuuexTOWq5dcaIqyHOFk3ywUsuDhv kLqwNHEg3mbtA== 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.7 08/26] perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count) Date: Thu, 29 Feb 2024 10:48:27 -0500 Message-ID: <20240229154851.2849367-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229154851.2849367-1-sashal@kernel.org> References: <20240229154851.2849367-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_074908_667282_0493D606 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 c584165b13bab..7e3aa7e2345fa 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, 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