]> git.baikalelectronics.ru Git - kernel.git/commitdiff
arm: pmu: Fix non-devicetree probing
authorMark Salter <msalter@redhat.com>
Tue, 7 Jun 2016 16:32:21 +0000 (11:32 -0500)
committerWill Deacon <will.deacon@arm.com>
Wed, 15 Jun 2016 08:51:35 +0000 (09:51 +0100)
There is a problem in the non-devicetree PMU probing where some
probe functions may get the number of supported events through
smp_call_function_any() using the arm_pmu supported_cpus mask.
But at the time the probe function is called, the supported_cpus
mask is empty so the call fails. This patch makes sure the mask
is set before calling the init function rather than after.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/perf/arm_pmu.c

index 1b8304e1efaa687d71226e62de7c56ac19340bd0..140436a046c03f992c3fa3fd71ed485bfdb7d109 100644 (file)
@@ -1010,8 +1010,8 @@ int arm_pmu_device_probe(struct platform_device *pdev,
                if (!ret)
                        ret = init_fn(pmu);
        } else {
-               ret = probe_current_pmu(pmu, probe_table);
                cpumask_setall(&pmu->supported_cpus);
+               ret = probe_current_pmu(pmu, probe_table);
        }
 
        if (ret) {