Skip to content

Commit f9bd34e

Browse files
rmurphy-armwilldeacon
authored andcommitted
perf/arm_cspmu: Clean up ACPI dependency
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 <[email protected]> Reviewed-by: Ilkka Koskinen <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/9d126711c7498b199b3e6f5cf48ca60ffb9df54c.1685983270.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 87b3b6d commit f9bd34e

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

drivers/perf/arm_cspmu/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
config ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU
66
tristate "ARM Coresight Architecture PMU"
7-
depends on ARM64 && ACPI
8-
depends on ACPI_APMT || COMPILE_TEST
7+
depends on ARM64 || COMPILE_TEST
98
help
109
Provides support for performance monitoring unit (PMU) devices
1110
based on ARM CoreSight PMU architecture. Note that this PMU

drivers/perf/arm_cspmu/arm_cspmu.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <linux/module.h>
2929
#include <linux/perf_event.h>
3030
#include <linux/platform_device.h>
31-
#include <acpi/processor.h>
3231

3332
#include "arm_cspmu.h"
3433
#include "nvidia_cspmu.h"
@@ -1075,6 +1074,9 @@ static int arm_cspmu_request_irq(struct arm_cspmu *cspmu)
10751074
return 0;
10761075
}
10771076

1077+
#if defined(CONFIG_ACPI) && defined(CONFIG_ARM64)
1078+
#include <acpi/processor.h>
1079+
10781080
static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)
10791081
{
10801082
u32 acpi_uid;
@@ -1099,7 +1101,7 @@ static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)
10991101
return -ENODEV;
11001102
}
11011103

1102-
static int arm_cspmu_get_cpus(struct arm_cspmu *cspmu)
1104+
static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
11031105
{
11041106
struct device *dev;
11051107
struct acpi_apmt_node *apmt_node;
@@ -1135,6 +1137,17 @@ static int arm_cspmu_get_cpus(struct arm_cspmu *cspmu)
11351137

11361138
return 0;
11371139
}
1140+
#else
1141+
static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
1142+
{
1143+
return -ENODEV;
1144+
}
1145+
#endif
1146+
1147+
static int arm_cspmu_get_cpus(struct arm_cspmu *cspmu)
1148+
{
1149+
return arm_cspmu_acpi_get_cpus(cspmu);
1150+
}
11381151

11391152
static int arm_cspmu_register_pmu(struct arm_cspmu *cspmu)
11401153
{

0 commit comments

Comments
 (0)