提交 4608af8a 编写于 作者: M Marc Zyngier 提交者: Pawel Moll

bus: arm-cci: Fix use of smp_processor_id() in preemptible context

The ARM CCI driver seem to be using smp_processor_id() in a
preemptible context, which is likely to make a DEBUG_PREMPT
kernel scream at boot time.

Turn this into a get_cpu()/put_cpu() that extends over the CPU
hotplug registration, making sure that we don't race against
a CPU down operation.
Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
Acked-by: NMark Rutland <mark.rutland@arm.com>
Cc: stable@vger.kernel.org # 4.2+
Signed-off-by: NPawel Moll <pawel.moll@arm.com>
上级 b18c2b94
...@@ -1755,14 +1755,17 @@ static int cci_pmu_probe(struct platform_device *pdev) ...@@ -1755,14 +1755,17 @@ static int cci_pmu_probe(struct platform_device *pdev)
raw_spin_lock_init(&cci_pmu->hw_events.pmu_lock); raw_spin_lock_init(&cci_pmu->hw_events.pmu_lock);
mutex_init(&cci_pmu->reserve_mutex); mutex_init(&cci_pmu->reserve_mutex);
atomic_set(&cci_pmu->active_events, 0); atomic_set(&cci_pmu->active_events, 0);
cpumask_set_cpu(smp_processor_id(), &cci_pmu->cpus); cpumask_set_cpu(get_cpu(), &cci_pmu->cpus);
ret = cci_pmu_init(cci_pmu, pdev); ret = cci_pmu_init(cci_pmu, pdev);
if (ret) if (ret) {
put_cpu();
return ret; return ret;
}
cpuhp_state_add_instance_nocalls(CPUHP_AP_PERF_ARM_CCI_ONLINE, cpuhp_state_add_instance_nocalls(CPUHP_AP_PERF_ARM_CCI_ONLINE,
&cci_pmu->node); &cci_pmu->node);
put_cpu();
pr_info("ARM %s PMU driver probed", cci_pmu->model->name); pr_info("ARM %s PMU driver probed", cci_pmu->model->name);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册