Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1076954rdb; Fri, 9 Feb 2024 09:31:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8YdYoZsp02qczHE/EZMo2ulitFQscfsde+ozyu8VzV/5M9ERyL+YoWUVsTQeesnMx28Af X-Received: by 2002:a17:90a:bc83:b0:296:15e7:8f33 with SMTP id x3-20020a17090abc8300b0029615e78f33mr2051413pjr.3.1707499900714; Fri, 09 Feb 2024 09:31:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707499900; cv=pass; d=google.com; s=arc-20160816; b=cigfVLnpJKY+MvzcnW9WU0CDQeiHZ0WPRegaxfcg0mzS7cfwh8OnPYlDouDGM9zGUr O6hgdxozVTXWBapwYfKlSUi22SUoocuuZImqH63Isj+rYcvX+J2va08hhKlz4s+p34I3 TsIu5JkArGhzGWKC22uQWJAalSkKk5OsA9l0wI677259Hzq7J+3/3x7MKRAzIBxlOf8+ DlFd2WPIIsJZajxNoAjIdxlV6PLYTWjriW45c13G+aJNeLzVUsvoyRRdRlMP4njYcDKG qJckQIJjSyIWR72Y0C60/eEp1uIP70TBqL3n0Piqsx9oCLBn2xJetLgp3L3gPJU4K3iS 5iOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=thaPLHN2aFrtVmSJm8bYRx3g6i/7SvwGClbRBNcW7o4=; fh=ujKTyEmcm7+I+c7URwUqDR0czc39f7pWQrpk+JlrV10=; b=qCbUrvUUpwXhvUGRvS6DkMik6COCBnfUJSVvCjP+SVCgTjte1jaDFAxaEMrWJujruP piYHxNNzJofDxUXfCaF1Uz2ORKbodHCx5naKSbuMyJsdRTiKHNUSEEtCqghFHY+WC5kf S+1Xd4t1Z8ASQfogz2HY7VSHM9hfMsBa4QpKEAW1PzmVZqzvsa9IkDBfbJq8yfkx3/AJ Eug1b8XnTKb80JaVEkQYGpPP2GBIe5+qpYoYWoWzcTAE2EBUOLmQ1PM0RVGVUbFd2eL2 uH6GX+/7c1MPQHCjdiU47iDqucyd2TqhiBtVHXLVZKhooQAytksVFRlZIROq8ye5KWGf DWIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pHwCJupY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59690-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWWz8X1s3If0eAPgX8kE5Zo01UYn/khZ9ME38b+l9bY2FM9aV3I2i5sqExFfmMkYOuTnlUNnikZL0mm2Rp0/c23wH532ceKRY6sNRK9dg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 75-20020a63014e000000b005c6b4e26664si1977790pgb.548.2024.02.09.09.31.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 09:31:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pHwCJupY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59690-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 8C35FB21BBD for ; Fri, 9 Feb 2024 17:03:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7813D7B3EE; Fri, 9 Feb 2024 17:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pHwCJupY" 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 A49C1364D2 for ; Fri, 9 Feb 2024 17:02:56 +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=1707498176; cv=none; b=HmW9z2wHdk3urmqJLVB/aMXSKUVHmZrorBlvNUi+WyQpSXcsr2VHQ6Av5vwWiJ9weBkSHsHx9jdsUjDqm86rtFe/COObMe4YPFPdOetxc/aadi5eERZT+I6leU/0D8psH6WII5oX315Flsmx3je087ziRdh0ZsRGBugIPcLxcPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498176; c=relaxed/simple; bh=HV4+Vvjfg7zEh12UhMMs9hnFdl+LJe31OtHo4omL6w8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SsPanJ6P0IJZ9A/ilRe5H1MdiOFEickWy6quN8OZm7gQNAOM5BJ4cmumN0TysJLDsxrvbh8VEjL08QIivryUCqwSbFjdAXf1mkFX6uQOV1OLQ/uBCPmKqhQ22O6aI3VKAD3OG1KHQqz5EjClLBMuaBVNKG79X0iHT+0CsSXwhx4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pHwCJupY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 130E1C433F1; Fri, 9 Feb 2024 17:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707498176; bh=HV4+Vvjfg7zEh12UhMMs9hnFdl+LJe31OtHo4omL6w8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pHwCJupYpd7Blvl75suI0jfQmiSuuXMLt9V4RYiILd5j3qhEemGZWtsZ+uSsM5d1R 5+Y2CJL1iZvH0nrdrj74FwumEVTaIkaxDLjeC22ggw99AB30xlms5VrdSmuz0psju7 f+5XfZ950hiB6GCywVxTO19u9Og7dJdkp5+LhBy1oxf1RuvdD07bSfpQ67RtuUctrA E2anDHDgTz4SI87IcjNs0X0pqxR1tFlmePffVTXuoMSRPFMtsX6fkCzttv/X05yvbh 47tFEhdUeaA/9VRLvRB0eJnwEAezMpZscxafJ1ZXe9jvs3qho4eHEpv/MiXK7jIA9K cINmRgcFF08Ww== Date: Fri, 9 Feb 2024 17:02:51 +0000 From: Will Deacon To: Ilkka Koskinen Cc: Robin Murphy , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count) Message-ID: <20240209170251.GA25069@willie-the-truck> References: <20240205194655.1567434-1-ilkka@os.amperecomputing.com> <8bf2275a-dea7-1817-731a-7d47d3b01d13@os.amperecomputing.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8bf2275a-dea7-1817-731a-7d47d3b01d13@os.amperecomputing.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Tue, Feb 06, 2024 at 01:04:27PM -0800, Ilkka Koskinen wrote: > On Tue, 6 Feb 2024, Robin Murphy wrote: > > On 2024-02-05 7:46 pm, Ilkka Koskinen wrote: > > 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, > > 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); > > > > Tested-by: Ilkka Koskinen Mind sending that out as a proper patch that I can pick up, please? Cheers, Will