Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp533139lqb; Thu, 29 Feb 2024 07:53:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWppnVOL3ya8jrIYY09Rgg8pSkpn23MSlvNqQQ2gwXjbDiSXz4mWTaDWxhjKY+vJ/TC0Jk5nJ4Z6l3G//+isoQ2jxyrHIqJF/B5aMmBbg== X-Google-Smtp-Source: AGHT+IGMWyYZodXLb9xnQyQ8UE5YZhAmcpGdhcvOObF4xElNFicwZX7+hFiGe7FMcalSBiPSEDmY X-Received: by 2002:a17:90a:7f8b:b0:29a:bd5b:380e with SMTP id m11-20020a17090a7f8b00b0029abd5b380emr2556065pjl.4.1709222034620; Thu, 29 Feb 2024 07:53:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709222034; cv=pass; d=google.com; s=arc-20160816; b=cz3jZMF6KE/tGAQFbTyuFnJ8LdwdF6uX2N2Y+tx+P4ugajgU8a2XzRQD1fLXx9RFuL tiZ5iQlwSiovlPq4ePDd/uwImABHHmgHLoc9EkWqwr1oXP+4hNdGerDPhgWjBxjWyvKm xDQiqGeezHYjpCXzukRt8A0cthI12fBCcaNbAN5lK2SjVEh0o7DO0ABWLwM5mlP/vICl JVQcL1lg4VXYeomZfnsgfSsilBDncOcXR/Qfz/PyCnqrnKYOUuy2sYuJuBr9aJC9d5wA +aahSq+55X3rotczqRSKSaQufPpDrBTkG0x1fWCCNffalYGJ8cqsZZGRRK8wAt+2kk4m ONmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=W0JD4E7Fq5CTa5FicxXCEW6q0jv3nilPQFfj/hZRyVY=; fh=esG5cP8gDweVznyKnVF00NPuNM3qP45ZDJ/Cdny/CTE=; b=oyy+zdiCDU+MdALWJ4Mtm7lMcZ5uRwrglEq1sZSG0L2SH+kp7g8VODIElKPkwxL50+ 5kWp6qQ5gj6OFJwyBQ9S0JKv4ZGlV7AFIjDDzx+rf4XcsMk/Ah09Vmv8b5XBIKDjKxMw VzeqscN9c/FHvwvmkoTY/DzfRFOq+O7BMNnGVFq4oRtRWKtBWwktta2m5qlGR6mgVkI6 3NABgkgWVkLoN/3oWAxnTrbWTBz5iD8fhBFQgEQXwmehEFoLplqKg5bTI/Jg3LVj5MJ1 3KcuyVLE6xQL12Jf43Zly7wrgc/s3F6yJffqbtEc4CaqbeUQ9qZQe6I+2VdZ9k7v1Vqb ReHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hh0jzMTP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-86956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id dj8-20020a17090ad2c800b00299248f4a26si1777152pjb.31.2024.02.29.07.53.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 07:53:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hh0jzMTP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-86956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 46672B24DB2 for ; Thu, 29 Feb 2024 15:51:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7645154439; Thu, 29 Feb 2024 15:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Hh0jzMTP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD5E9152DE8; Thu, 29 Feb 2024 15:49:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709221747; cv=none; b=eDemj1x9AgTuQo5m5GQtWT/UmVUJCFs+1wSF21/k150ZO4NLZ5eFyKNtE1Iy/jrfEAKihwSUuqSNLIms9ArVwqxqJ/2aPMa84v7AzLo6gKNAPlMdncXUnjH/wFLkouaipD1L6ZPIm8oVZcC2r5xDLtMLh1JZMGl1hjBDDt5laW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709221747; c=relaxed/simple; bh=5F7XSSCngd7SJiSXtRGZSco15qRwSXu6/QNItN9LrzE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TLJbIAUD3aMkd9OwG5lSvfDCFmKld1tiK9+jnBsk7DEWK5zpfyH/T/hnq1YJFLVbs0FmzuYv1X6TtqDZi4nVXEH2Tm1nfT0mr+YVm5d/g52dvhFfni2GMzPni4lZ0ikx6thY1piVG5pv47Joaj23c/VnjSZJWDRaLgyZQFnbJQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hh0jzMTP; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.6 Content-Transfer-Encoding: 8bit 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