From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754002AbdIDRbC (ORCPT ); Mon, 4 Sep 2017 13:31:02 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60496 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928AbdIDRau (ORCPT ); Mon, 4 Sep 2017 13:30:50 -0400 From: Marc Zyngier To: Lorenzo Pieralisi , Suzuki K Poulose , Pawel Moll , Mark Rutland Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] bus: arm-cci: Fix use of smp_processor_id() in preemptible context Date: Mon, 4 Sep 2017 18:30:41 +0100 Message-Id: <20170904173041.14119-3-marc.zyngier@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170904173041.14119-1-marc.zyngier@arm.com> References: <20170904173041.14119-1-marc.zyngier@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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