* [PATCH] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association
@ 2024-12-23 12:51 Yicong Yang
2024-12-23 16:22 ` Jonathan Cameron
2025-01-08 16:38 ` Will Deacon
0 siblings, 2 replies; 3+ messages in thread
From: Yicong Yang @ 2024-12-23 12:51 UTC (permalink / raw)
To: will, mark.rutland, linux-arm-kernel, linux-kernel
Cc: jonathan.cameron, prime.zeng, linuxarm, yangyicong
From: Yicong Yang <yangyicong@hisilicon.com>
For PMUs with no association, the hisi_pmu->on_cpu is initialized
according to the NUMA locality but use a wrong CPU for the interrupt
affinity. The CPU selected from cpumask_local_spread() can be different
from the CPU by the cpuhp callback. Fix this by setting the IRQ affinity
to hisi_pmu->on_cpu.
Fixes: 6cd137088fdf ("drivers/perf: hisi: Refactor the detection of associated CPUs")
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c
index 83bdc9c31367..ef058b1dd509 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
@@ -510,7 +510,7 @@ int hisi_uncore_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
return 0;
hisi_pmu->on_cpu = cpumask_local_spread(0, dev_to_node(hisi_pmu->dev));
- WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(cpu)));
+ WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(hisi_pmu->on_cpu)));
return 0;
}
--
2.24.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association
2024-12-23 12:51 [PATCH] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association Yicong Yang
@ 2024-12-23 16:22 ` Jonathan Cameron
2025-01-08 16:38 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-12-23 16:22 UTC (permalink / raw)
To: Yicong Yang
Cc: will, mark.rutland, linux-arm-kernel, linux-kernel, prime.zeng,
linuxarm, yangyicong
On Mon, 23 Dec 2024 20:51:34 +0800
Yicong Yang <yangyicong@huawei.com> wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> For PMUs with no association, the hisi_pmu->on_cpu is initialized
> according to the NUMA locality but use a wrong CPU for the interrupt
> affinity. The CPU selected from cpumask_local_spread() can be different
> from the CPU by the cpuhp callback. Fix this by setting the IRQ affinity
> to hisi_pmu->on_cpu.
>
> Fixes: 6cd137088fdf ("drivers/perf: hisi: Refactor the detection of associated CPUs")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c
> index 83bdc9c31367..ef058b1dd509 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c
> +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
> @@ -510,7 +510,7 @@ int hisi_uncore_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
> return 0;
>
> hisi_pmu->on_cpu = cpumask_local_spread(0, dev_to_node(hisi_pmu->dev));
> - WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(cpu)));
> + WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(hisi_pmu->on_cpu)));
> return 0;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association
2024-12-23 12:51 [PATCH] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association Yicong Yang
2024-12-23 16:22 ` Jonathan Cameron
@ 2025-01-08 16:38 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2025-01-08 16:38 UTC (permalink / raw)
To: mark.rutland, linux-arm-kernel, linux-kernel, Yicong Yang
Cc: catalin.marinas, kernel-team, Will Deacon, jonathan.cameron,
prime.zeng, linuxarm, yangyicong
On Mon, 23 Dec 2024 20:51:34 +0800, Yicong Yang wrote:
> For PMUs with no association, the hisi_pmu->on_cpu is initialized
> according to the NUMA locality but use a wrong CPU for the interrupt
> affinity. The CPU selected from cpumask_local_spread() can be different
> from the CPU by the cpuhp callback. Fix this by setting the IRQ affinity
> to hisi_pmu->on_cpu.
>
>
> [...]
Applied to will (for-next/perf), thanks!
[1/1] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association
https://git.kernel.org/will/c/555c6e9b03c1
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-01-08 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-23 12:51 [PATCH] drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association Yicong Yang
2024-12-23 16:22 ` Jonathan Cameron
2025-01-08 16:38 ` 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).