From patchwork Mon Sep 25 16:28:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 144497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1344701vqu; Mon, 25 Sep 2023 09:44:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IED9Smstp8Hw6cfJBaK6WyiCVmqfT0FglJff+WxpioyQRQHLgUjyqHjqkha5wm5j+LqMXj6 X-Received: by 2002:a05:6a20:8e19:b0:15a:f7fd:dd97 with SMTP id y25-20020a056a208e1900b0015af7fddd97mr8308796pzj.2.1695660255629; Mon, 25 Sep 2023 09:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695660255; cv=none; d=google.com; s=arc-20160816; b=dfgVxmU7C+EZn5aQmAZbi4Jnbdp3ZZGhChXbtZuVRC4++BdMtqRlyj2ShjR2iOns6D Aytdvns/m+aj4ltMDb3pNO7hGiHO288P5lQEvaDQmmpLuTtFf/W6HSNx7UpFUqdv+3yJ KtzGhGONGPCEJ5O42n5MABKy3L2LStY9duNeAVRU+PiVJBWn3kAJed3mn4eKYAm8+0Pt EItOxIidha9FAqekvtKRq0eNR+kWSEZCKiYgt+G0+SKTb2ezw/qMQgVtOII1oN8cJER+ yixWv58FwI9q5OxqbvGLXmp05s3ww28SJyhTJ0BPRcgx3R39Q0FNCM94G1qCbWnMwK1C lOoA== 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:dkim-signature; bh=qjYxvP0mrwNQum3AINuFgWcLiPmukjSCAlOcMPWNC70=; fh=nvvPwaR1OLWUo7NXfFyb0oQsr/1AtL5DJpgyJn5ndF8=; b=ya34yS/65pQNGGMQYJ31lr5IRUkhdSYHu58YO/2a8icfP5SfaHvSnq2LJUt4W2a2QD zOnCnMys1GpCxxFJ1dNP0JdPsPFyRZVArYHIDAcAXYF6PA14zbj8QpWiZgrX+23gQs3C 0+Omrcr0IcWmBkWq9gq4GNm/RemzYKJIQWZ7Nh/3gxXMRfrqSTU9sf5VPed6/G2yOZmI GMA5fcf86SL3d/QS4PkALtoIaUsS4vpHC6avkVG7hIjnDH7aabtAAH7e2b/57YXwcPan rjWrPU7AchT5wKz9iSSavpDtR2HDhY/KKh4Uje6uJgZcVEYfOMwFnir9W96gmhikAKSM U4pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=H7LRzpes; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o8-20020a056a001bc800b0068a3c575900si9948069pfw.84.2023.09.25.09.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 09:44:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=H7LRzpes; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 8636D80B31E4; Mon, 25 Sep 2023 09:29:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232062AbjIYQ3A (ORCPT + 29 others); Mon, 25 Sep 2023 12:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjIYQ2z (ORCPT ); Mon, 25 Sep 2023 12:28:55 -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 7989AFC; Mon, 25 Sep 2023 09:28:47 -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:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qjYxvP0mrwNQum3AINuFgWcLiPmukjSCAlOcMPWNC70=; b=H7LRzpeszu/NjlEcIS+36zsQZ6 1B2GjUbmFECUohpWGtvulUpk25WC7XKYTRHHT/Eml4mDxX0AMEEVJ060wH21PeS3gfykNAY0NM0X4 +GWdzx+YKVVo1kbovXqnfBMQBs1dqZfTnGZ7fo2JV+E0m3nna6kCsI5T89nijgI58vuJn5P29+V4C TXReirRZWjAEDIygIzmuA0o2B8fguAE2q+5Iicf9b35Wzovei5lcs3hzooqVcv2w+BQzFB8kmlAql ls3/NA9AIJUS/9j4ONw4bjJEaiyshFeUbtMhnMk82oY4iHK+oHm6dodVie7aPbYAkW55ITbJCUDoG wexoGNlg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:56656 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 1qkoRq-0001Ke-1k; Mon, 25 Sep 2023 17:28:38 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qkoRr-0088Q8-Da; Mon, 25 Sep 2023 17:28:39 +0100 From: "Russell King (Oracle)" To: Thomas Gleixner Cc: linux-acpi@vger.kernel.org, James Morse , loongarch@lists.linux.dev, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, Borislav Petkov , Dave Hansen , x86@kernel.org, Salil Mehta , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , linux-ia64@vger.kernel.org Subject: [PATCH] cpu-hotplug: provide prototypes for arch CPU registration MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Mon, 25 Sep 2023 17:28:39 +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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:29:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778028648152631770 X-GMAIL-MSGID: 1778028648152631770 Provide common prototypes for arch_register_cpu() and arch_unregister_cpu(). These are called by acpi_processor.c, with weak versions, so the prototype for this is already set. It is generally not necessary for function prototypes to be conditional on preprocessor macros. Some architectures (e.g. Loongarch) are missing the prototype for this, and rather than add it to Loongarch's asm/cpu.h, lets do the job once for everyone. Since this covers everyone, remove the now unnecessary prototypes in asm/cpu.h, and we also need to remove the 'static' from one of ia64's arch_register_cpu() definitions. Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: - drop ia64 changes, as ia64 has already been removed. arch/x86/include/asm/cpu.h | 2 -- arch/x86/kernel/topology.c | 2 +- include/linux/cpu.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h index 3a233ebff712..25050d953eee 100644 --- a/arch/x86/include/asm/cpu.h +++ b/arch/x86/include/asm/cpu.h @@ -28,8 +28,6 @@ struct x86_cpu { }; #ifdef CONFIG_HOTPLUG_CPU -extern int arch_register_cpu(int num); -extern void arch_unregister_cpu(int); extern void soft_restart_cpu(void); #endif diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index ca004e2e4469..0bab03130033 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c @@ -54,7 +54,7 @@ void arch_unregister_cpu(int num) EXPORT_SYMBOL(arch_unregister_cpu); #else /* CONFIG_HOTPLUG_CPU */ -static int __init arch_register_cpu(int num) +int __init arch_register_cpu(int num) { return register_cpu(&per_cpu(cpu_devices, num).cpu, num); } diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 0abd60a7987b..eb768a866fe3 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -80,6 +80,8 @@ extern __printf(4, 5) struct device *cpu_device_create(struct device *parent, void *drvdata, const struct attribute_group **groups, const char *fmt, ...); +extern int arch_register_cpu(int cpu); +extern void arch_unregister_cpu(int cpu); #ifdef CONFIG_HOTPLUG_CPU extern void unregister_cpu(struct cpu *cpu); extern ssize_t arch_cpu_probe(const char *, size_t);