]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf/arm-cmn: Initialise cmn->cpu earlier
authorRobin Murphy <robin.murphy@arm.com>
Mon, 12 May 2025 17:11:54 +0000 (18:11 +0100)
committerWill Deacon <will@kernel.org>
Fri, 16 May 2025 14:18:58 +0000 (15:18 +0100)
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>
Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Link: https://lore.kernel.org/r/b12fccba6b5b4d2674944f59e4daad91cd63420b.1747069914.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c

index 83f4ef9852555a4f17dac789d994b4e87f9bb74c..668c581e932a1423f35f146ed6e12dc5c02604ae 100644 (file)
@@ -2551,6 +2551,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)) {
@@ -2578,7 +2579,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,