diff options
author | Mark Rutland <mark.rutland@arm.com> | 2017-04-11 11:39:52 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-04-11 18:29:53 +0300 |
commit | 3cf7ee98b8489fd2ff58374e3882a666f81d629f (patch) | |
tree | 7de4edbe9624d15f20a750300c8588d4aba1def5 /drivers/perf | |
parent | 0e2663d921ea1861540cd7f331d8e2c7668aa31f (diff) | |
download | linux-3cf7ee98b8489fd2ff58374e3882a666f81d629f.tar.xz |
drivers/perf: arm_pmu: move irq request/free into probe
Currently we request (and potentially free) all IRQs for a given PMU in
cpu_pmu_init(). This works for platform/DT probing today, but it doesn't
fit ACPI well as we don't have all our affinity data up-front.
In preparation for ACPI support, fold the IRQ request/free into
arm_pmu_device_probe(), which will remain specific to platform/DT
probing.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/perf')
-rw-r--r-- | drivers/perf/arm_pmu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index c09c379b038d..f387d6153099 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -758,10 +758,6 @@ static int cpu_pmu_init(struct arm_pmu *cpu_pmu) { int err; - err = armpmu_request_irqs(cpu_pmu); - if (err) - goto out; - err = cpuhp_state_add_instance(CPUHP_AP_PERF_ARM_STARTING, &cpu_pmu->node); if (err) @@ -777,7 +773,6 @@ out_unregister: cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_STARTING, &cpu_pmu->node); out: - armpmu_free_irqs(cpu_pmu); return err; } @@ -1073,12 +1068,18 @@ int arm_pmu_device_probe(struct platform_device *pdev, goto out_free; } + ret = armpmu_request_irqs(pmu); + if (ret) + goto out_free_irqs; + ret = armpmu_register(pmu); if (ret) goto out_free; return 0; +out_free_irqs: + armpmu_free_irqs(pmu); out_free: pr_info("%s: failed to register PMU devices!\n", of_node_full_name(node)); |