diff options
author | Mark Rutland <mark.rutland@arm.com> | 2017-04-11 04:39:57 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-04-11 11:29:54 -0400 |
commit | f00fa5f4163b40c3ec8590d9a7bd845c19bf8d16 (patch) | |
tree | 0b78d7b6459597f70def23ada56b82c8ec21fdc5 | |
parent | f1b36dcb5c316c276ca6faedc50d89d97f90d960 (diff) |
arm64: pmuv3: use arm_pmu ACPI framework
Now that we have a framework to handle the ACPI bits, make the PMUv3
code use this. The framework is a little different to what was
originally envisaged, and we can drop some unused support code in the
process of moving over to it.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
[will: make armv8_pmu_driver_init static]
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 53f235465fc4..98c749394c4b 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c | |||
@@ -1136,24 +1136,9 @@ static const struct of_device_id armv8_pmu_of_device_ids[] = { | |||
1136 | {}, | 1136 | {}, |
1137 | }; | 1137 | }; |
1138 | 1138 | ||
1139 | /* | ||
1140 | * Non DT systems have their micro/arch events probed at run-time. | ||
1141 | * A fairly complete list of generic events are provided and ones that | ||
1142 | * aren't supported by the current PMU are disabled. | ||
1143 | */ | ||
1144 | static const struct pmu_probe_info armv8_pmu_probe_table[] = { | ||
1145 | PMU_PROBE(0, 0, armv8_pmuv3_init), /* enable all defined counters */ | ||
1146 | { /* sentinel value */ } | ||
1147 | }; | ||
1148 | |||
1149 | static int armv8_pmu_device_probe(struct platform_device *pdev) | 1139 | static int armv8_pmu_device_probe(struct platform_device *pdev) |
1150 | { | 1140 | { |
1151 | if (acpi_disabled) | 1141 | return arm_pmu_device_probe(pdev, armv8_pmu_of_device_ids, NULL); |
1152 | return arm_pmu_device_probe(pdev, armv8_pmu_of_device_ids, | ||
1153 | NULL); | ||
1154 | |||
1155 | return arm_pmu_device_probe(pdev, armv8_pmu_of_device_ids, | ||
1156 | armv8_pmu_probe_table); | ||
1157 | } | 1142 | } |
1158 | 1143 | ||
1159 | static struct platform_driver armv8_pmu_driver = { | 1144 | static struct platform_driver armv8_pmu_driver = { |
@@ -1164,4 +1149,11 @@ static struct platform_driver armv8_pmu_driver = { | |||
1164 | .probe = armv8_pmu_device_probe, | 1149 | .probe = armv8_pmu_device_probe, |
1165 | }; | 1150 | }; |
1166 | 1151 | ||
1167 | builtin_platform_driver(armv8_pmu_driver); | 1152 | static int __init armv8_pmu_driver_init(void) |
1153 | { | ||
1154 | if (acpi_disabled) | ||
1155 | return platform_driver_register(&armv8_pmu_driver); | ||
1156 | else | ||
1157 | return arm_pmu_acpi_probe(armv8_pmuv3_init); | ||
1158 | } | ||
1159 | device_initcall(armv8_pmu_driver_init) | ||