arm: perf: Set affinity for PPI based PMUs
Subsystems (3)
PATCH 1/1 arm: perf: Set affinity for PPI based PMUs
For PPI based PMUs, we bail out early in of_pmu_irq_cfg() without setting the PMU's supported_cpus bitmap. This causes the smp_call_function_any() in armv7_probe_num_events() to fail. Set the bitmap to be all CPUs so that we properly probe PMUs that use PPIs.
--- arch/arm/kernel/perf_event.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/kernel/perf_event.c +3 -1
@@ -795,8 +795,10 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)/* Don't bother with PPIs; they're already affine */ irq =platform_get_irq (pdev,0 ); -if (irq >=0 &&irq_is_percpu (irq)) +if (irq >=0 &&irq_is_percpu (irq)) { +cpumask_setall (&pmu->supported_cpus);return 0 ; + } irqs =kcalloc (pdev->num_resources,sizeof (*irqs),GFP_KERNEL );if (!irqs)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Hi Stephen,
Quoted 18 lines · Stephen Boyd
For PPI based PMUs, we bail out early in
of_pmu_irq_cfg()without setting the PMU'ssupported_cpusbitmap. This causes thesmp_call_function_any()inarmv7_probe_num_events()to fail. Set the bitmap to be all CPUs so that we properly probe PMUs that use PPIs.Fixes cc88116da0d1 ("arm: perf: treat PMUs as CPU affine")Cc Mark Rutland <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- arch/arm/kernel/perf_event.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/kernel/perf_event.c +0
-0
arch/arm/kernel/perf_event.c static int of_pmu_irq_cfg(struct arm_pmu *pmu) · line 801
Quoted 8 lines
arch/arm/kernel/perf_event.c +3
-1@@ -795,8 +795,10 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)/* Don't bother with PPIs; they're already affine */ irq =platform_get_irq (pdev,0 ); -if (irq >=0 &&irq_is_percpu (irq)) +if (irq >=0 &&irq_is_percpu (irq)) { +cpumask_setall (&pmu->supported_cpus);return 0 ; + }
Looks good to me as a fix, but I'm currently working on extending the interrupt-affinity property to work with both SPIs and PPIs so that we can use it to identify PMU affinity on multi-cluster systems.
Any chance you could take that for a spin on your platform, please?
Will
Stephen Boyd
Tested-byQuoted 8 lines · Will Deacon
Looks good to me as a fix, but I'm currently working on extending the interrupt-affinity property to work with both SPIs and PPIs so that we can use it to identify PMU affinity on multi-cluster systems.
Any chance you could take that for a spin on your platform, please?
The patch you point to works fine on Krait based platforms when the interrupt-affinity property isn't present in DT. We (luckily?) don't have any multi-cluster Krait designs so we don't need to add the interrupt-affinity property in those DTs. Feel free to add a
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project