Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726213 > unrolled thread

[PATCH 2/2] bus: arm-cci: Fix use of smp_processor_id() in preemptible context

Started byMarc Zyngier <marc.zyngier@arm.com>
First post2017-09-04 19:40 +0200
Last post2017-09-04 19:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] bus: arm-cci: Fix use of smp_processor_id() in preemptible context Marc Zyngier <marc.zyngier@arm.com> - 2017-09-04 19:40 +0200

#1726213 — [PATCH 2/2] bus: arm-cci: Fix use of smp_processor_id() in preemptible context

FromMarc Zyngier <marc.zyngier@arm.com>
Date2017-09-04 19:40 +0200
Subject[PATCH 2/2] bus: arm-cci: Fix use of smp_processor_id() in preemptible context
Message-ID<um3vQ-8os-29@gated-at.bofh.it>
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.

Turning this into a get_cpu()/put_cpu() should make it behave.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/bus/arm-cci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index c49da15d9790..e2873789972a 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -1755,7 +1755,8 @@ static int cci_pmu_probe(struct platform_device *pdev)
 	raw_spin_lock_init(&cci_pmu->hw_events.pmu_lock);
 	mutex_init(&cci_pmu->reserve_mutex);
 	atomic_set(&cci_pmu->active_events, 0);
-	cpumask_set_cpu(smp_processor_id(), &cci_pmu->cpus);
+	cpumask_set_cpu(get_cpu(), &cci_pmu->cpus);
+	put_cpu();
 
 	ret = cci_pmu_init(cci_pmu, pdev);
 	if (ret)
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web