* [PATCH] arm: perf: Set affinity for PPI based PMUs
@ 2015-06-29 21:58 Stephen Boyd
2015-06-30 8:52 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2015-06-29 21:58 UTC (permalink / raw)
To: linux-arm-kernel
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.
Fixes: cc88116da0d1 ("arm: perf: treat PMUs as CPU affine")
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
arch/arm/kernel/perf_event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 54272e0be713..7d5379c1c443 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -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)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] arm: perf: Set affinity for PPI based PMUs
2015-06-29 21:58 [PATCH] arm: perf: Set affinity for PPI based PMUs Stephen Boyd
@ 2015-06-30 8:52 ` Will Deacon
2015-07-01 1:19 ` Stephen Boyd
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2015-06-30 8:52 UTC (permalink / raw)
To: linux-arm-kernel
Hi Stephen,
On Mon, Jun 29, 2015 at 10:58:46PM +0100, Stephen Boyd wrote:
> 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.
>
> Fixes: cc88116da0d1 ("arm: perf: treat PMUs as CPU affine")
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> arch/arm/kernel/perf_event.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index 54272e0be713..7d5379c1c443 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -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.
https://git.kernel.org/cgit/linux/kernel/git/will/linux.git/commit/?h=perf/updates&id=633fa0b629d86e58d68aff295f92031877dd0294
Any chance you could take that for a spin on your platform, please?
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] arm: perf: Set affinity for PPI based PMUs
2015-06-30 8:52 ` Will Deacon
@ 2015-07-01 1:19 ` Stephen Boyd
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2015-07-01 1:19 UTC (permalink / raw)
To: linux-arm-kernel
On 06/30/2015 01:52 AM, Will Deacon wrote:
> 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.
>
> https://git.kernel.org/cgit/linux/kernel/git/will/linux.git/commit/?h=perf/updates&id=633fa0b629d86e58d68aff295f92031877dd0294
>
> 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
Tested-by: Stephen Boyd <sboyd@codeaurora.org> # Krait PMU
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-01 1:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 21:58 [PATCH] arm: perf: Set affinity for PPI based PMUs Stephen Boyd
2015-06-30 8:52 ` Will Deacon
2015-07-01 1:19 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).