From patchwork Thu Apr 30 11:40:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 11519927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B8121392 for ; Thu, 30 Apr 2020 11:40:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CF5D20775 for ; Thu, 30 Apr 2020 11:40:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726815AbgD3LkY (ORCPT ); Thu, 30 Apr 2020 07:40:24 -0400 Received: from foss.arm.com ([217.140.110.172]:53028 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbgD3LkY (ORCPT ); Thu, 30 Apr 2020 07:40:24 -0400 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 782E1106F; Thu, 30 Apr 2020 04:40:24 -0700 (PDT) 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 E8B883F305; Thu, 30 Apr 2020 04:40:22 -0700 (PDT) From: Qais Yousef To: Thomas Gleixner , "Rafael J . Wysocki" Cc: Qais Yousef , Len Brown , Pavel Machek , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Todd E Brandt , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] cpu/hotplug: Remove __freeze_secondary_cpus() Date: Thu, 30 Apr 2020 12:40:04 +0100 Message-Id: <20200430114004.17477-2-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200430114004.17477-1-qais.yousef@arm.com> References: <20200430114004.17477-1-qais.yousef@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The refactored function is no longer required as the codepaths that call freeze_secondary_cpus() are all suspend/resume related now. Signed-off-by: Qais Yousef CC: "Rafael J. Wysocki" CC: Len Brown CC: Pavel Machek CC: Ingo Molnar CC: Borislav Petkov CC: "H. Peter Anvin" CC: x86@kernel.org CC: Todd E Brandt CC: linux-pm@vger.kernel.org CC: linux-kernel@vger.kernel.org --- include/linux/cpu.h | 7 +------ kernel/cpu.c | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 9d34dc3b859f..52692587f7fe 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -144,12 +144,7 @@ static inline void get_online_cpus(void) { cpus_read_lock(); } static inline void put_online_cpus(void) { cpus_read_unlock(); } #ifdef CONFIG_PM_SLEEP_SMP -int __freeze_secondary_cpus(int primary, bool suspend); -static inline int freeze_secondary_cpus(int primary) -{ - return __freeze_secondary_cpus(primary, true); -} - +extern int freeze_secondary_cpus(int primary); extern void thaw_secondary_cpus(void); static inline int suspend_disable_secondary_cpus(void) diff --git a/kernel/cpu.c b/kernel/cpu.c index 10c60e9f58b7..8d57c3cfe862 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1327,7 +1327,7 @@ void bringup_nonboot_cpus(unsigned int setup_max_cpus) #ifdef CONFIG_PM_SLEEP_SMP static cpumask_var_t frozen_cpus; -int __freeze_secondary_cpus(int primary, bool suspend) +int freeze_secondary_cpus(int primary) { int cpu, error = 0; @@ -1352,7 +1352,7 @@ int __freeze_secondary_cpus(int primary, bool suspend) if (cpu == primary) continue; - if (suspend && pm_wakeup_pending()) { + if (pm_wakeup_pending()) { pr_info("Wakeup pending. Abort CPU freeze\n"); error = -EBUSY; break;