]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drivers/perf: arm_pmu: move irq request/free into probe
authorMark Rutland <mark.rutland@arm.com>
Tue, 11 Apr 2017 08:39:52 +0000 (09:39 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 17 May 2017 16:41:07 +0000 (13:41 -0300)
BugLink: https://bugs.launchpad.net/bugs/1689661
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>
(cherry picked from commit 3cf7ee98b8489fd2ff58374e3882a666f81d629f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/perf/arm_pmu.c

index 077be952d64cab75811d4432ad8781abc08949f0..46b7af3621adff1b4f37e50f40dda2c39c885cfb 100644 (file)
@@ -757,10 +757,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)
@@ -776,7 +772,6 @@ out_unregister:
        cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_STARTING,
                                            &cpu_pmu->node);
 out:
-       armpmu_free_irqs(cpu_pmu);
        return err;
 }
 
@@ -1072,12 +1067,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));