From patchwork Wed Jun 26 22:32:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 13713493 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 6A407C30653 for ; Wed, 26 Jun 2024 22:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fM0zN3bNI0Nxe2ZtOoyBwuMs2G/rKrgFJk7rIZtXKPI=; b=4OGgUgpojzIlwfNf/VlBP/Z93s 9hkWY3WWyuI7RrNZXvhVZX9E2tUCNTzxQtmWKbs8Fj3C9i6hcWryi5kFXA7KagYQhXloAh6NL6tue i4ai+BuNi+Z/IYdsuDvWjXFi5e7KpxhyZukQU1jFM69DCWAx1n7SyAtfZfn3Oznzy2QqY0SXmgKA+ Y4JmBPn5A7Y83uVEJCKLfzkA4Fpy3MPKQK7PtpdfybQH+Z2/WEOcvh2RwpdF+OWQuMiGlj/kEUTv1 CbA2gfTUEz8FvD4hk+WwS8f9O7UifhqfjXkEutocg62m8kIIHrWiKicz9qkWLarEzOPm+10DQ4RMg UaCxa3sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMbCS-00000008Vgf-0GZo; Wed, 26 Jun 2024 22:33:12 +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 1sMbBz-00000008VPO-0Kim for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2024 22:32:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 522B661D4B; Wed, 26 Jun 2024 22:32:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD2AC116B1; Wed, 26 Jun 2024 22:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719441162; bh=UXu/vYT7z9xueyiMh9oVfGVDaCYh7CYZteWRCP/n2vw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y7A8KtU3icL5K+CqxnTpfga9PToceSLSRlHeYiuez22VIG2THH6IZBsL4zncldrgH V3fiyEYZsIDKLDnLWD7w2WSznTttuCquhxJnh6/Prt0Prehg+VLopjIHYWV/UXGrth POIKJXUOlr0gCwxUuqj9cmhk2uaWqapW4eWWRNG75sc/QgHJj4sm3yNpzEMeQIsAeT aRu0R6pZbHmXmGiBxe+PegdczKon/MU/jKuWvzICnLhA7WmgexgDEJYfoXwDqe1HlL 4HY3zqY76HPJ2g/rh0CaCGCua1Foi4WBuAA/+mwI8lK/r7Tpm+tBjA3wokmDBTl3yy bXONyZNqEdULw== From: "Rob Herring (Arm)" Date: Wed, 26 Jun 2024 16:32:27 -0600 Subject: [PATCH v2 03/12] perf/arm: Move 32-bit PMU drivers to drivers/perf/ MIME-Version: 1.0 Message-Id: <20240626-arm-pmu-3-9-icntr-v2-3-c9784b4f4065@kernel.org> References: <20240626-arm-pmu-3-9-icntr-v2-0-c9784b4f4065@kernel.org> In-Reply-To: <20240626-arm-pmu-3-9-icntr-v2-0-c9784b4f4065@kernel.org> To: Russell King , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , James Clark Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvmarm@lists.linux.dev X-Mailer: b4 0.14-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_153243_459172_F4A273D5 X-CRM114-Status: GOOD ( 14.00 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It is preferred to put drivers under drivers/ rather than under arch/. The PMU drivers also depend on arm_pmu.c, so it's better to place them all together. Acked-by: Mark Rutland Signed-off-by: Rob Herring (Arm) --- arch/arm/kernel/Makefile | 2 -- drivers/perf/Kconfig | 12 ++++++++++++ drivers/perf/Makefile | 3 +++ arch/arm/kernel/perf_event_v6.c => drivers/perf/arm_v6_pmu.c | 3 --- arch/arm/kernel/perf_event_v7.c => drivers/perf/arm_v7_pmu.c | 3 --- .../perf_event_xscale.c => drivers/perf/arm_xscale_pmu.c | 3 --- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 89a77e3f51d2..aaae31b8c4a5 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -78,8 +78,6 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o -obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \ - perf_event_v7.o AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o obj-$(CONFIG_VDSO) += vdso.o diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig index 7526a9e714fa..aa9530b4064f 100644 --- a/drivers/perf/Kconfig +++ b/drivers/perf/Kconfig @@ -56,6 +56,18 @@ config ARM_PMU Say y if you want to use CPU performance monitors on ARM-based systems. +config ARM_V6_PMU + depends on ARM_PMU && (CPU_V6 || CPU_V6K) + def_bool y + +config ARM_V7_PMU + depends on ARM_PMU && CPU_V7 + def_bool y + +config ARM_XSCALE_PMU + depends on ARM_PMU && CPU_XSCALE + def_bool y + config RISCV_PMU depends on RISCV bool "RISC-V PMU framework" diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile index 29b1c28203ef..d43df81d52f7 100644 --- a/drivers/perf/Makefile +++ b/drivers/perf/Makefile @@ -6,6 +6,9 @@ obj-$(CONFIG_ARM_DSU_PMU) += arm_dsu_pmu.o obj-$(CONFIG_ARM_PMU) += arm_pmu.o arm_pmu_platform.o obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o obj-$(CONFIG_ARM_PMUV3) += arm_pmuv3.o +obj-$(CONFIG_ARM_V6_PMU) += arm_v6_pmu.o +obj-$(CONFIG_ARM_V7_PMU) += arm_v7_pmu.o +obj-$(CONFIG_ARM_XSCALE_PMU) += arm_xscale_pmu.o obj-$(CONFIG_ARM_SMMU_V3_PMU) += arm_smmuv3_pmu.o obj-$(CONFIG_FSL_IMX8_DDR_PMU) += fsl_imx8_ddr_perf.o obj-$(CONFIG_FSL_IMX9_DDR_PMU) += fsl_imx9_ddr_perf.o diff --git a/arch/arm/kernel/perf_event_v6.c b/drivers/perf/arm_v6_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event_v6.c rename to drivers/perf/arm_v6_pmu.c index d9fd53841591..f7593843bb85 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/drivers/perf/arm_v6_pmu.c @@ -31,8 +31,6 @@ * enable the interrupt. */ -#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) - #include #include @@ -445,4 +443,3 @@ static struct platform_driver armv6_pmu_driver = { }; builtin_platform_driver(armv6_pmu_driver); -#endif /* CONFIG_CPU_V6 || CONFIG_CPU_V6K */ diff --git a/arch/arm/kernel/perf_event_v7.c b/drivers/perf/arm_v7_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event_v7.c rename to drivers/perf/arm_v7_pmu.c index a3322e2b3ea4..fdd936fbd188 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/drivers/perf/arm_v7_pmu.c @@ -17,8 +17,6 @@ * counter and all 4 performance counters together can be reset separately. */ -#ifdef CONFIG_CPU_V7 - #include #include #include @@ -2002,4 +2000,3 @@ static struct platform_driver armv7_pmu_driver = { }; builtin_platform_driver(armv7_pmu_driver); -#endif /* CONFIG_CPU_V7 */ diff --git a/arch/arm/kernel/perf_event_xscale.c b/drivers/perf/arm_xscale_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event_xscale.c rename to drivers/perf/arm_xscale_pmu.c index 7a2ba1c689a7..3d8b72d6b37f 100644 --- a/arch/arm/kernel/perf_event_xscale.c +++ b/drivers/perf/arm_xscale_pmu.c @@ -13,8 +13,6 @@ * PMU structures. */ -#ifdef CONFIG_CPU_XSCALE - #include #include @@ -745,4 +743,3 @@ static struct platform_driver xscale_pmu_driver = { }; builtin_platform_driver(xscale_pmu_driver); -#endif /* CONFIG_CPU_XSCALE */