perf/arm-cmn: Move IRQs when migrating context
authorRobin Murphy <robin.murphy@arm.com>
Thu, 28 Jan 2021 13:12:44 +0000 (13:12 +0000)
committerWill Deacon <will@kernel.org>
Thu, 28 Jan 2021 20:14:45 +0000 (20:14 +0000)
If we migrate the PMU context to another CPU, we need to remember to
retarget the IRQs as well.

Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/e080640aea4ed8dfa870b8549dfb31221803eb6b.1611839564.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c

index 6bdf13f..1328159 100644 (file)
@@ -1150,7 +1150,7 @@ static int arm_cmn_commit_txn(struct pmu *pmu)
 static int arm_cmn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
 {
        struct arm_cmn *cmn;
-       unsigned int target;
+       unsigned int i, target;
 
        cmn = hlist_entry_safe(node, struct arm_cmn, cpuhp_node);
        if (cpu != cmn->cpu)
@@ -1161,6 +1161,8 @@ static int arm_cmn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
                return 0;
 
        perf_pmu_migrate_context(&cmn->pmu, cpu, target);
+       for (i = 0; i < cmn->num_dtcs; i++)
+               irq_set_affinity_hint(cmn->dtc[i].irq, cpumask_of(target));
        cmn->cpu = target;
        return 0;
 }