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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD177C7EE29 for ; Fri, 2 Jun 2023 16:02:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236246AbjFBQCm (ORCPT ); Fri, 2 Jun 2023 12:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbjFBQCk (ORCPT ); Fri, 2 Jun 2023 12:02:40 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 054E7197 for ; Fri, 2 Jun 2023 09:02:38 -0700 (PDT) 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 F29371063; Fri, 2 Jun 2023 09:03:23 -0700 (PDT) Received: from [10.57.22.125] (unknown [10.57.22.125]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 89EE83F7BD; Fri, 2 Jun 2023 09:02:37 -0700 (PDT) Message-ID: <90979d06-1f6b-90ee-4a68-0f5cc013c82a@arm.com> Date: Fri, 2 Jun 2023 17:02:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 Subject: Re: [PATCH 3/4] perf/arm_cspmu: Clean up ACPI dependency To: Robin Murphy , will@kernel.org Cc: mark.rutland@arm.com, bwicaksono@nvidia.com, ilkka@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <70067704d217cd7504d9552d8485a54e5c071c90.1685619571.git.robin.murphy@arm.com> From: Suzuki K Poulose In-Reply-To: <70067704d217cd7504d9552d8485a54e5c071c90.1685619571.git.robin.murphy@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/06/2023 12:59, Robin Murphy wrote: > Build-wise, the ACPI dependency consists of only a couple of things > which could probably stand being factored out into ACPI helpers anyway. > However for the immediate concern of working towards Devicetree support > here, it's easy enough to make a few tweaks to contain the affected code > locally, such that we can relax the Kconfig dependency. > > Signed-off-by: Robin Murphy > --- > drivers/perf/arm_cspmu/Kconfig | 3 +-- > drivers/perf/arm_cspmu/arm_cspmu.c | 17 +++++++++++++++-- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/perf/arm_cspmu/Kconfig b/drivers/perf/arm_cspmu/Kconfig > index 0b316fe69a45..25d25ded0983 100644 > --- a/drivers/perf/arm_cspmu/Kconfig > +++ b/drivers/perf/arm_cspmu/Kconfig > @@ -4,8 +4,7 @@ > > config ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU > tristate "ARM Coresight Architecture PMU" > - depends on ARM64 && ACPI > - depends on ACPI_APMT || COMPILE_TEST > + depends on ARM64 || COMPILE_TEST > help > Provides support for performance monitoring unit (PMU) devices > based on ARM CoreSight PMU architecture. Note that this PMU > diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c > index 72dc7a9e1ca8..3b91115c376d 100644 > --- a/drivers/perf/arm_cspmu/arm_cspmu.c > +++ b/drivers/perf/arm_cspmu/arm_cspmu.c > @@ -28,7 +28,6 @@ > #include > #include > #include > -#include > > #include "arm_cspmu.h" > #include "nvidia_cspmu.h" > @@ -1075,6 +1074,9 @@ static int arm_cspmu_request_irq(struct arm_cspmu *cspmu) > return 0; > } > > +#if defined(CONFIG_ACPI) && defined(CONFIG_ARM64) > +#include > + > static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid) > { > u32 acpi_uid; > @@ -1099,7 +1101,7 @@ static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid) > return -ENODEV; > } > > -static int arm_cspmu_get_cpus(struct arm_cspmu *cspmu) > +static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu) > { > struct device *dev; > struct acpi_apmt_node *apmt_node; > @@ -1135,6 +1137,17 @@ static int arm_cspmu_get_cpus(struct arm_cspmu *cspmu) > > return 0; > } > +#else > +static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu) > +{ > + return -ENODEV; > +} > +#endif > + > +static int arm_cspmu_get_cpus(struct arm_cspmu *cspmu) > +{ > + return arm_cspmu_acpi_get_cpus(cspmu); > +} > > static int arm_cspmu_register_pmu(struct arm_cspmu *cspmu) > { Reviewed-and-Tested-by: Suzuki K Poulose