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 4FC6FC433EF for ; Tue, 14 Dec 2021 13:37:40 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dHX6D7XeDQPKmGJ+5Ef/kH2zcJHUohEL576md89Qy3o=; b=FrabAG3Go2j7tG r9/lPvVq5q4degCkSNGp3/PBS9cBQ8H+al//6Jt8vR6pbDhqMdbhMfQvSTF6yHhMD7jKXmIaKrWRa NMTCBpBbW4ydFzJmMERFTsmFqpvX3qupxdDZSLO37JsKbtPaOtBV5+ngIBFfauEEUjZvAmlkYmb8F Q/reY2aeFZx80bbAnsnYcXL71n9gOX/J0Pf4eLJsJJuVwz2t3rg5xmpffHKPaW2z/EoWJBj6hZ12S S1URk79LAiJjjbxcLDxIAvP6BXLD8zkPJKM8lquMHwShX+jMB3H6A8JcUAt/B9ftfhT1Ly7b0VaGG 9qBP6J4WfPoTpBZ9PyRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx7yl-00EBbC-KV; Tue, 14 Dec 2021 13:36:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx7yh-00EBaG-Dj for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 13:36:25 +0000 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 2AAA66D; Tue, 14 Dec 2021 05:36:22 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.66.239]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B9B843F793; Tue, 14 Dec 2021 05:36:20 -0800 (PST) Date: Tue, 14 Dec 2021 13:36:18 +0000 From: Mark Rutland To: Robin Murphy Cc: will@kernel.org, catalin.marinas@arm.com, robh+dt@kernel.org, suzuki.poulose@arm.com, thierry.reding@gmail.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: Re: [PATCH 3/5] arm64: perf: Support new DT compatibles Message-ID: References: <579f301dbf5347d20cfdf49480b850cba82c1ca2.1638900542.git.robin.murphy@arm.com> <428b2e70-0ab1-8acc-3cbd-4df131976e27@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <428b2e70-0ab1-8acc-3cbd-4df131976e27@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211214_053623_556642_13035966 X-CRM114-Status: GOOD ( 23.18 ) 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 On Tue, Dec 07, 2021 at 07:14:29PM +0000, Robin Murphy wrote: > On 2021-12-07 18:44, Mark Rutland wrote: > > On Tue, Dec 07, 2021 at 06:20:41PM +0000, Robin Murphy wrote: > > > Wire up the new DT compatibles so we can present appropriate > > > PMU names to userspace for the latest and greatest CPUs. > > > > > > Signed-off-by: Robin Murphy > > > --- > > > arch/arm64/kernel/perf_event.c | 36 ++++++++++++++++++++++++++++++++++ > > > 1 file changed, 36 insertions(+) > > > > > > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > > > index 57720372da62..3fe4dcfc28d4 100644 > > > --- a/arch/arm64/kernel/perf_event.c > > > +++ b/arch/arm64/kernel/perf_event.c > > > @@ -1215,6 +1215,26 @@ static int armv8_a78_pmu_init(struct arm_pmu *cpu_pmu) > > > return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a78", NULL); > > > } > > > +static int armv9_a510_pmu_init(struct arm_pmu *cpu_pmu) > > > +{ > > > + return armv8_pmu_init_nogroups(cpu_pmu, "armv9_cortex_a510", NULL); > > > +} > > > + > > > +static int armv9_a710_pmu_init(struct arm_pmu *cpu_pmu) > > > +{ > > > + return armv8_pmu_init_nogroups(cpu_pmu, "armv9_cortex_a710", NULL); > > > +} > > > + > > > +static int armv8_x1_pmu_init(struct arm_pmu *cpu_pmu) > > > +{ > > > + return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_x1", NULL); > > > +} > > > + > > > +static int armv9_x2_pmu_init(struct arm_pmu *cpu_pmu) > > > +{ > > > + return armv8_pmu_init_nogroups(cpu_pmu, "armv9_cortex_x2", NULL); > > > +} > > > > I wonder if it'd be better to do something like: > > > > #define PMU_INIT_SIMPLE(name) \ > > static int name##_pmu_init(struct arm_pmu *cpu_pmu) \ > > { > > return armv8_pmu_init_nogroups(cpu_pmu, #name, NULL); \ > > } > > > > PMU_INIT_SIMPLE(armv9_cortex_a510) > > PMU_INIT_SIMPLE(armv9_cortex_a710) > > PMU_INIT_SIMPLE(armv8_xortex_x1) > > PMU_INIT_SIMPLE(armv9_xortex_x2) > > > > ... and fix up the armv8_pmu_of_device_ids[] table to use the longer init names > > that results in? > > Indeed I did ponder doing almost exactly that, but at that point I'd rather > try refactoring a bit deeper to convert most of the arm_pmu init business to > pure data, so I figured I'd chuck in the simple tweak to mitigate these new > additions with minimal churn, then have a go at the bigger change in its own > right. Sure; that makes sense to me, so for this as-is: Acked-by: Mark Rutland ... and I'll leave it to Will to have the final say on whether we want the "armv9_" prefix or whether we stick with "armv8_" for consistenct, when he chooses to pick this. One thing I've just realised is that for the ACPI case, we're stuck with "armv8_pmuv3_%d" regardless, which I think is fine itself, but we might want to call that out. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel