Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2752596ybc; Mon, 25 Nov 2019 03:39:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwf7RkvuyliWuFDq1ncLG7RvViAyQWVCpLagp4DEQM/GwJKqwMx23syeF+1vhQXuXmD6qLP X-Received: by 2002:a17:906:b310:: with SMTP id n16mr36339738ejz.129.1574681979205; Mon, 25 Nov 2019 03:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574681979; cv=none; d=google.com; s=arc-20160816; b=txWdavoTBSw2UNvcmX1/5l9BKoI+gIqD4kkLeA0FnrqSOSyhTmUjOTPJCLvle+7Kmx UeV/y1Fp+YIobOdFYVGQIiEa+bPh/XHTy+8PDGyGk++/KKlSIHFytukpXGDFLlbiykw2 Ta7+3nEBzgd7Fogvo/f1HtKk2Nue6whfqJR9OAYNDusM0wYF7yi8EbAI6vpAEx/S4soC tr1eujxZn7a0D7DnrcRKt9RffFQzwPdgQQk1zLjm29MGKFb0XRQkEMS5XdBlud0Eg+L9 wRw3jnlN5w82G8YWZdbC9a4DcvmUGlNxybIFrwav8eZ8yEkXOImfmSH4vxZCtQ2vHwLB UAIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=tDtowBxt0Ju8aJBpa+s7AgEDisA8TVAzEuL0NoC3jNo=; b=PyFacZ9mRgorITBoHPPnIZbuM3VcpFaaxHtHXl14Epk/QlnCpsgbQYMYyf17Jkh6eg FRPuEsP2a6amL5Ww2w/AYTsT7sLn2yjhm0w5Epuy7WXdD08f0Bd+5aO45px49QKnEdod VouoTxO+hD8o53i0Sc/AgUMdkGQ7lQaxVhr8zSWyouESle/cLR51maeik3FpB7JXthqc +0XVmKYuqTADvmCnGN/6zBurqo2VcQtu3ho77zdGcROVF2vet5gQKynjSkELtZoHiec5 EWJEyE3Qx1PUfqaD5bwSODmAYC/1LXHCBy8iV6+Wn1q94kG8ktkFkS4f1TVB5+zrOGao ncmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si4219599ejr.10.2019.11.25.03.39.14; Mon, 25 Nov 2019 03:39:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727730AbfKYL2K (ORCPT + 99 others); Mon, 25 Nov 2019 06:28:10 -0500 Received: from foss.arm.com ([217.140.110.172]:48936 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727722AbfKYL2J (ORCPT ); Mon, 25 Nov 2019 06:28:09 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 311F811D4; Mon, 25 Nov 2019 03:28:09 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 169633F52E; Mon, 25 Nov 2019 03:28:07 -0800 (PST) From: Qais Yousef To: Thomas Gleixner , Greg Kroah-Hartman Cc: Qais Yousef , Russell King , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/14] arm: arm64: Don't use disable_nonboot_cpus() Date: Mon, 25 Nov 2019 11:27:43 +0000 Message-Id: <20191125112754.25223-4-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191125112754.25223-1-qais.yousef@arm.com> References: <20191125112754.25223-1-qais.yousef@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org disable_nonboot_cpus() is not safe to use when doing machine_down(), because it relies on freeze_secondary_cpus() which in return is a suspend/resume related freeze and could abort if the logic detects any pending activities that can prevent finishing the offlining process. Beside disable_nonboot_cpus() is dependent on CONFIG_PM_SLEEP_SMP which is an othogonal config to rely on to ensure this function works correctly. Signed-off-by: Qais Yousef CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org --- arch/arm/kernel/reboot.c | 4 ++-- arch/arm64/kernel/process.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index bb18ed0539f4..58ad1a70f770 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -88,11 +88,11 @@ void soft_restart(unsigned long addr) * to execute e.g. a RAM-based pin loop is not sufficient. This allows the * kexec'd kernel to use any and all RAM as it sees fit, without having to * avoid any code or data used by any SW CPU pin loop. The CPU hotplug - * functionality embodied in disable_nonboot_cpus() to achieve this. + * functionality embodied in smp_shutdown_nonboot_cpus() to achieve this. */ void machine_shutdown(void) { - disable_nonboot_cpus(); + smp_shutdown_nonboot_cpus(0); } /* diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 71f788cd2b18..3bcc9bfc581e 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -141,11 +141,11 @@ void arch_cpu_idle_dead(void) * to execute e.g. a RAM-based pin loop is not sufficient. This allows the * kexec'd kernel to use any and all RAM as it sees fit, without having to * avoid any code or data used by any SW CPU pin loop. The CPU hotplug - * functionality embodied in disable_nonboot_cpus() to achieve this. + * functionality embodied in smpt_shutdown_nonboot_cpus() to achieve this. */ void machine_shutdown(void) { - disable_nonboot_cpus(); + smp_shutdown_nonboot_cpus(0); } /* -- 2.17.1