Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1963422rda; Tue, 24 Oct 2023 08:21:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGruT7dSIPHnkNzjzzCRDj44RCZxBKvl9rxOh2+SI5q4HzlyWJkQq8VpVQ57VHPF1tezSE X-Received: by 2002:a05:6358:cd20:b0:168:e68f:ad59 with SMTP id gv32-20020a056358cd2000b00168e68fad59mr4910095rwb.2.1698160917421; Tue, 24 Oct 2023 08:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698160917; cv=none; d=google.com; s=arc-20160816; b=F0FcOCrOOMpXKCKH+GUy30/J3rXMG0Oks9wD6CG6w2a2dD7RYFqR4V7UXsrAE4Av5M uhoK7u2qFNAul+SvRQpLjSRw07tHggMw1+ZjhTIitOYQPfAPf198XuAnQC5R4647xQAo a7xByuAq41abNpksDlSLXgBJawqcw0GhoEffhCrDIABGEv73q1CURfzkoxUG5v9kKMOs CuztMf3QlHBoFShThdeqWVpEphuvg6rndKS/I0rMCWLEsZ6FdtIz7+cu7Mp/bHGPsEiJ m1RP/tkivOT2dGxjzcQZvnkyaImEnMMww1QxYgfA/Pp+k40pnQYl1n5xsQzm44/9hWAJ eWMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=WZbzkCjdwwVjCi6ik6/j9bw5XoM5xlmMFky9eUQSenA=; fh=SkTV5xOrq7hxTIOggvbIOXu+48dqXijvMNKji0VGfy8=; b=U2175wk92Wh+t0YOo/kjwR8cASUhvgRMUZb5sX4DxnwoVJ28UyBk4+5b9h4R5/LufQ VVkzUWQEMcPFv+MjTekrcklHNXmFPfQq1WvSykFQgGEeu1kwpSekAaXlfCAOtnPH1A/8 gyyh8AI/tdaoKmJzJbUXIqc5s8pOuSTQBsa0Q/FjzRIZUEUuXbpC+bS6ratFm868inkn asnvHkNjTsajbE0ljOiGj+w8df9txWMJjFmsXSJmZhWSwI9NRRYgznt852T2cVkfexC5 BXlKxw8mud43pbDSIFURoJPPSW2nAXr1CJFyaq3zUYGudlgxoLw2pOUa9+TIQW9QoKoT 5XHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=gKCkKOAZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b7-20020a637147000000b005b8613a8148si8099295pgn.136.2023.10.24.08.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=gKCkKOAZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 58F1280C281E; Tue, 24 Oct 2023 08:21:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343595AbjJXPVk (ORCPT + 99 others); Tue, 24 Oct 2023 11:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234844AbjJXPUg (ORCPT ); Tue, 24 Oct 2023 11:20:36 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A024310E6; Tue, 24 Oct 2023 08:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WZbzkCjdwwVjCi6ik6/j9bw5XoM5xlmMFky9eUQSenA=; b=gKCkKOAZ0KqFervshuGqvwmREQ 1SYOnpeNyHcTmLUF2CDz9nOuBibvq/HcEf/qBRhWrLVFZDsYQCcCCt/eTjt/17v4pl+gvofX37abY xw6f8rrlNfkaS4dqwiHa0POcXJMKT2mH/mcH1HgLNksyKPfFwscw0KD/ksVDhCdcPDncOUYyAwfZA 65waJQvkNcCPV/zv+Idp4JDhz49uMnm3vnUiK0H5ewKDU1on6E23PKrgGTkytP8Fxf4q6HDFUmVHe IMcHUKxv7X8MiUWZxeOHJ+DYBpbu5fdM/kpnKUPN7ybJJUTgovRTezeYYJcI6NyLEtW8d+CKSNiWG wmmO2rqw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46120 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qvJAe-0004TN-1R; Tue, 24 Oct 2023 16:18:16 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvJAf-00AqRG-UX; Tue, 24 Oct 2023 16:18:17 +0100 In-Reply-To: References: From: Russell King (Oracle) To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , "Rafael J. Wysocki" , Len Brown Subject: [PATCH 25/39] ACPI: Rename acpi_processor_hotadd_init and remove pre-processor guards MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Tue, 24 Oct 2023 16:18:17 +0100 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:21:48 -0700 (PDT) From: James Morse acpi_processor_hotadd_init() will make a CPU present by mapping it based on its hardware id. 'hotadd_init' is ambiguous once there are two different behaviours for cpu hotplug. This is for toggling the _STA present bit. Subsequent patches will add support for toggling the _STA enabled bit, named acpi_processor_make_enabled(). Rename it acpi_processor_make_present() to make it clear this is for CPUs that were not previously present. Expose the function prototypes it uses to allow the preprocessor guards to be removed. The IS_ENABLED() check will let the compiler dead-code elimination pass remove this if it isn't going to be used. Signed-off-by: James Morse --- drivers/acpi/acpi_processor.c | 14 +++++--------- include/linux/acpi.h | 2 -- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index c8e960ff0aca..26e3efb74614 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -183,13 +183,15 @@ static void __init acpi_pcc_cpufreq_init(void) {} #endif /* CONFIG_X86 */ /* Initialization */ -#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU -static int acpi_processor_hotadd_init(struct acpi_processor *pr) +static int acpi_processor_make_present(struct acpi_processor *pr) { unsigned long long sta; acpi_status status; int ret; + if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) + return -ENODEV; + if (invalid_phys_cpuid(pr->phys_id)) return -ENODEV; @@ -223,12 +225,6 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) cpu_maps_update_done(); return ret; } -#else -static inline int acpi_processor_hotadd_init(struct acpi_processor *pr) -{ - return -ENODEV; -} -#endif /* CONFIG_ACPI_HOTPLUG_PRESENT_CPU */ static int acpi_processor_get_info(struct acpi_device *device) { @@ -335,7 +331,7 @@ static int acpi_processor_get_info(struct acpi_device *device) * because cpuid <-> apicid mapping is persistent now. */ if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) { - int ret = acpi_processor_hotadd_init(pr); + int ret = acpi_processor_make_present(pr); if (ret) return ret; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 48ee36086577..3672312e15eb 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -321,12 +321,10 @@ static inline int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu, } #endif -#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU /* Arch dependent functions for cpu hotplug support */ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, int *pcpu); int acpi_unmap_cpu(int cpu); -#endif /* CONFIG_ACPI_HOTPLUG_PRESENT_CPU */ #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr); -- 2.30.2