Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1390155pxu; Fri, 27 Nov 2020 06:17:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOs4zOCncDE5m4QrwVh71dIlSPEJGh6ohzC6QTElAWlCxzJcsTO6Ta3Vz8u1lC1GkqPILx X-Received: by 2002:a50:9f2e:: with SMTP id b43mr7876726edf.239.1606486651911; Fri, 27 Nov 2020 06:17:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606486651; cv=none; d=google.com; s=arc-20160816; b=BvNTQH+CwSiEZkAPLxjkJmYY1gi+puYcEpitGpQ0XT0kyVr7h7pwfY+T8BdQKTi0YB uxP30B0d1m8TpUsDyz1ETTOXWsLAjmKny0DbpU/t4NR04XJG9bXbqFN2Vr0L9lBDipf/ emd+7Idy5oHQc4PJzf6JcgYb7GHEZKTs80K0/u4+o+LFqjNAi3b0izfbWorRjPv/Z15j ouvn5WK1xmJCq8UK2ZlVc2hnDuZO91Ak3NgTv0d3BnEz2xu8A/ZsueyIc09Ne8+cecXO 2f32BawfHGnaFPS8B4UMevFY+zvDF7UgEeDAH9NFSBtV0XeDz+PLukBY7uPrWlyup0qX sKnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=rB1DnOBBlUA6EonJfs0wczAc9CTpMC42lMfCIRFhsdc=; b=gnZSiFqvbQOmvi8ZW4ndfkDGmyhfnvv8Gqx06M00wiJrIIucZTAzEfQolkDZb2n8tc w6LEqLPDEWBLe5GDzLJ1jg+kPUsiTnHm5Q2NQMWBS4wiPDhuaHx8jM7w5WLTpIIVTreR I7HZ+kByfQ7irfoIFdCdxUuwyXI2TBNwQh8twsTVPyBSMOO9cpH66p/x1TqBpBl4Du3X vHQAC9/6v6Lf8n6dZ7k2efQPgoMT2Tmqx6cRlUORv2wLCZSRc9ZjOfVz9ZvwWEA+EybD pNcptgiB/B6Nn15IPUNkhbG4PUrR50AZpBW1tokkRIgdjxPzUWlWTGnII4xHky2kDrwH xWNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx24si5175413edb.419.2020.11.27.06.17.06; Fri, 27 Nov 2020 06:17:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730708AbgK0OPq (ORCPT + 99 others); Fri, 27 Nov 2020 09:15:46 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:44457 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729169AbgK0OPq (ORCPT ); Fri, 27 Nov 2020 09:15:46 -0500 X-UUID: 39b06dfbacf6492395d7d85238445d02-20201127 X-UUID: 39b06dfbacf6492395d7d85238445d02-20201127 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1652452230; Fri, 27 Nov 2020 22:15:37 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 27 Nov 2020 22:15:32 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 27 Nov 2020 22:15:33 +0800 From: Hanks Chen To: Thomas Gleixner , Jason Cooper , Marc Zyngier , Matthias Brugger , Russell King , Catalin Marinas , Will Deacon , Mark Rutland CC: , , , CC Hwang , Kuohong Wang , Loda Chou , Hanks Chen Subject: [PATCH v1 2/3] arm: disable irq on cpu shutdown flow Date: Fri, 27 Nov 2020 22:15:30 +0800 Message-ID: <1606486531-25719-3-git-send-email-hanks.chen@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1606486531-25719-1-git-send-email-hanks.chen@mediatek.com> References: <1606486531-25719-1-git-send-email-hanks.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 51FF224ED26ADDFF5E1372E7DC0ED8DD164EB61E564AED9D7CBF5263AC81A60A2000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Disable irq on cpu shutdown flow to ensure interrupts did not bother this cpu after status as offline. To avoid suspicious RCU usage [0:swapper/0]RCU used illegally from offline CPU! ... [0:swapper/0]lockdep: [name:lockdep&]cpu_id = 0, cpu_is_offline = 1 Signed-off-by: Hanks Chen --- arch/arm/kernel/smp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 48099c6e1e4a..6b8f72490320 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -262,6 +262,12 @@ int __cpu_disable(void) remove_cpu_topology(cpu); #endif + /* + * we disable irq here to ensure interrupts + * did not bother this cpu after status as offline. + */ + local_irq_disable(); + /* * Take this CPU offline. Once we clear this, we can't return, * and we must not schedule until we're ready to give up the cpu. @@ -600,11 +606,11 @@ static void ipi_cpu_stop(unsigned int cpu) raw_spin_unlock(&stop_lock); } - set_cpu_online(cpu, false); - local_fiq_disable(); local_irq_disable(); + set_cpu_online(cpu, false); + while (1) { cpu_relax(); wfe(); -- 2.18.0