]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drivers/perf: hisi: Set correct IRQ affinity for PMUs with no association
authorYicong Yang <yangyicong@hisilicon.com>
Mon, 23 Dec 2024 12:51:34 +0000 (20:51 +0800)
committerWill Deacon <will@kernel.org>
Tue, 7 Jan 2025 17:17:32 +0000 (17:17 +0000)
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>
Link: https://lore.kernel.org/r/20241223125134.57885-1-yangyicong@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/hisilicon/hisi_uncore_pmu.c

index 83bdc9c313673049aa46f50084e4f7c448516a25..ef058b1dd50949d5b9fb8e24aca5a5f14beb3193 100644 (file)
@@ -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;
        }