]> git.dujemihanovic.xyz Git - linux.git/commitdiff
perf/arm_cspmu: Clean up ACPI dependency
authorRobin Murphy <robin.murphy@arm.com>
Mon, 5 Jun 2023 17:01:33 +0000 (18:01 +0100)
committerWill Deacon <will@kernel.org>
Fri, 9 Jun 2023 10:26:47 +0000 (11:26 +0100)
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.

Reviewed-and-Tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/9d126711c7498b199b3e6f5cf48ca60ffb9df54c.1685983270.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_cspmu/Kconfig
drivers/perf/arm_cspmu/arm_cspmu.c

index 0b316fe69a45c3c87dd1cdcffb030a83861b14ed..25d25ded098322b38b66e0907fbacc2b4dbc94cb 100644 (file)
@@ -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
index e8bc8fc1fb9c09a23214e155407346b194939f4e..42abe433b7a455e50334ca3f1ce359f66a526d67 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/module.h>
 #include <linux/perf_event.h>
 #include <linux/platform_device.h>
-#include <acpi/processor.h>
 
 #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 <acpi/processor.h>
+
 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)
 {