mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
drivers/perf: hisi: Support PMUs with no interrupt
We'll have PMUs don't have an interrupt to indicate the counter overflow, but the Uncore PMU core assume all the PMUs have interrupt. So handle this case in the core. The existing PMUs won't be affected. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Link: https://lore.kernel.org/r/20250619125557.57372-7-yangyicong@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
35f5b36e8c
commit
e480898e76
@ -510,7 +510,9 @@ int hisi_uncore_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
hisi_pmu->on_cpu = cpumask_local_spread(0, dev_to_node(hisi_pmu->dev));
|
hisi_pmu->on_cpu = cpumask_local_spread(0, dev_to_node(hisi_pmu->dev));
|
||||||
WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(hisi_pmu->on_cpu)));
|
if (hisi_pmu->irq > 0)
|
||||||
|
WARN_ON(irq_set_affinity(hisi_pmu->irq,
|
||||||
|
cpumask_of(hisi_pmu->on_cpu)));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,6 +527,7 @@ int hisi_uncore_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
|
|||||||
hisi_pmu->on_cpu = cpu;
|
hisi_pmu->on_cpu = cpu;
|
||||||
|
|
||||||
/* Overflow interrupt also should use the same CPU */
|
/* Overflow interrupt also should use the same CPU */
|
||||||
|
if (hisi_pmu->irq > 0)
|
||||||
WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(cpu)));
|
WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(cpu)));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -560,6 +563,8 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
|
|||||||
perf_pmu_migrate_context(&hisi_pmu->pmu, cpu, target);
|
perf_pmu_migrate_context(&hisi_pmu->pmu, cpu, target);
|
||||||
/* Use this CPU for event counting */
|
/* Use this CPU for event counting */
|
||||||
hisi_pmu->on_cpu = target;
|
hisi_pmu->on_cpu = target;
|
||||||
|
|
||||||
|
if (hisi_pmu->irq > 0)
|
||||||
WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(target)));
|
WARN_ON(irq_set_affinity(hisi_pmu->irq, cpumask_of(target)));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user