linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/arm-cmn: Initialise cmn->cpu earlier
@ 2025-05-12 17:11 Robin Murphy
  2025-05-13 19:10 ` Ilkka Koskinen
  2025-05-16 15:37 ` Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Robin Murphy @ 2025-05-12 17:11 UTC (permalink / raw)
  To: will; +Cc: mark.rutland, linux-arm-kernel, linux-perf-users, stable

For all the complexity of handling affinity for CPU hotplug, what we've
apparently managed to overlook is that arm_cmn_init_irqs() has in fact
always been setting the *initial* affinity of all IRQs to CPU 0, not the
CPU we subsequently choose for event scheduling. Oh dear.

Cc: stable@vger.kernel.org
Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index aa2908313558..e385f187a084 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -2558,6 +2558,7 @@ static int arm_cmn_probe(struct platform_device *pdev)
 
 	cmn->dev = &pdev->dev;
 	cmn->part = (unsigned long)device_get_match_data(cmn->dev);
+	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
 	platform_set_drvdata(pdev, cmn);
 
 	if (cmn->part == PART_CMN600 && has_acpi_companion(cmn->dev)) {
@@ -2585,7 +2586,6 @@ static int arm_cmn_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
 	cmn->pmu = (struct pmu) {
 		.module = THIS_MODULE,
 		.parent = cmn->dev,
-- 
2.39.2.101.g768bb238c484.dirty



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/arm-cmn: Initialise cmn->cpu earlier
  2025-05-12 17:11 [PATCH] perf/arm-cmn: Initialise cmn->cpu earlier Robin Murphy
@ 2025-05-13 19:10 ` Ilkka Koskinen
  2025-05-16 15:37 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Ilkka Koskinen @ 2025-05-13 19:10 UTC (permalink / raw)
  To: Robin Murphy
  Cc: will, mark.rutland, linux-arm-kernel, linux-perf-users, stable



On Mon, 12 May 2025, Robin Murphy wrote:
> For all the complexity of handling affinity for CPU hotplug, what we've
> apparently managed to overlook is that arm_cmn_init_irqs() has in fact
> always been setting the *initial* affinity of all IRQs to CPU 0, not the
> CPU we subsequently choose for event scheduling. Oh dear.
>
> Cc: stable@vger.kernel.org
> Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Good catch.

Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>

> ---
> drivers/perf/arm-cmn.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index aa2908313558..e385f187a084 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
> @@ -2558,6 +2558,7 @@ static int arm_cmn_probe(struct platform_device *pdev)
>
> 	cmn->dev = &pdev->dev;
> 	cmn->part = (unsigned long)device_get_match_data(cmn->dev);
> +	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
> 	platform_set_drvdata(pdev, cmn);
>
> 	if (cmn->part == PART_CMN600 && has_acpi_companion(cmn->dev)) {
> @@ -2585,7 +2586,6 @@ static int arm_cmn_probe(struct platform_device *pdev)
> 	if (err)
> 		return err;
>
> -	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
> 	cmn->pmu = (struct pmu) {
> 		.module = THIS_MODULE,
> 		.parent = cmn->dev,
> -- 
> 2.39.2.101.g768bb238c484.dirty
>
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/arm-cmn: Initialise cmn->cpu earlier
  2025-05-12 17:11 [PATCH] perf/arm-cmn: Initialise cmn->cpu earlier Robin Murphy
  2025-05-13 19:10 ` Ilkka Koskinen
@ 2025-05-16 15:37 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2025-05-16 15:37 UTC (permalink / raw)
  To: Robin Murphy
  Cc: catalin.marinas, kernel-team, Will Deacon, mark.rutland,
	linux-arm-kernel, linux-perf-users, stable

On Mon, 12 May 2025 18:11:54 +0100, Robin Murphy wrote:
> For all the complexity of handling affinity for CPU hotplug, what we've
> apparently managed to overlook is that arm_cmn_init_irqs() has in fact
> always been setting the *initial* affinity of all IRQs to CPU 0, not the
> CPU we subsequently choose for event scheduling. Oh dear.
> 
> 

Applied to will (for-next/perf), thanks!

[1/1] perf/arm-cmn: Initialise cmn->cpu earlier
      https://git.kernel.org/will/c/597704e20106

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-16 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 17:11 [PATCH] perf/arm-cmn: Initialise cmn->cpu earlier Robin Murphy
2025-05-13 19:10 ` Ilkka Koskinen
2025-05-16 15:37 ` Will Deacon

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).