From patchwork Wed Oct 11 12:34:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 151412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp505367vqb; Wed, 11 Oct 2023 05:35:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvjDdS3+hJZY/sn4GiewjpvSR9DfLrT/SvRZqx8XsV5ZqZw05NQ+VvbSh4kHdrtciVlX6e X-Received: by 2002:a05:6a20:3d85:b0:163:f945:42c4 with SMTP id s5-20020a056a203d8500b00163f94542c4mr24512134pzi.1.1697027701540; Wed, 11 Oct 2023 05:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697027701; cv=none; d=google.com; s=arc-20160816; b=pWluizVY4cmX0YZNyyhpsqAnG06DLIknAhUpdr//0H8WeHOlgcTrFr9PMFCAqqY+dx x46xwWba1mKkm+GRk6HTzJXRTyQzS87fU1XvwVdIHOA4Aogeiau25kLuGEn95q91ZiDr nkXBfQHsEIeAohxLRZr00tA0OspOKplcFaa9qBAneDn6upmkzzQWKXhcU/XD0HgGxagN aai2vsbtYWqgSzKsf+mlxDToJo1kNwmzTB/F3wJn4/ZGMGeTh164Y/JVIZKcdH1CGwN2 0tLEckbXE1rnfv3H3DLaw1JG85n85is84Ip/CnRZjRhb1ZtOnk4tjOwFfwAeMX4ONa2w hywg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=lRLz5u7rlrapgnDTjt3gDSupwa+PRH+Rw4WNxZmPyb0=; fh=Y2kt7dnmgipjv4RvdMMHlkkorg8bwGaRKTvsvJuwLBE=; b=m5dGgGM9AWT6jUY3gDRVckQNa8KqgKFacSfczIZF2+M8FVREmFON1Yc8DLWcuG5rCb SEQL7fLSSI4k8D75xolWMTC9tbl3rKJX7Ww9shKnnoG3DzNpM0ldfVtl3AXG2+WB3wnk AU05vGdOnnUiWjUZbZA3y3M7py5x3aq4+oxCxE6ikboxEmcR7f2vXsa3Eeb59MOjmYxI tVdLHJfc1kaSl7ojC4m0koT3Q7GA/d/rOtRYTKeB/4lXf7oPQTzQzynFvPRCnIFkL/4r Krg+kf9ESwhLSXaYLWzcdiyp8XcTNrW0JEwGZa5hlew4ksQMq4CgE4ChrQNP1sq6Zug7 mcxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=n4QIALyd; dkim=neutral (no key) header.i=@linutronix.de header.b=WiuildRm; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id gp3-20020a17090adf0300b002776ebaec7fsi1502009pjb.122.2023.10.11.05.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:35:01 -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=pass header.i=@linutronix.de header.s=2020 header.b=n4QIALyd; dkim=neutral (no key) header.i=@linutronix.de header.b=WiuildRm; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 368498135BE0; Wed, 11 Oct 2023 05:34:59 -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 S232005AbjJKMel (ORCPT + 18 others); Wed, 11 Oct 2023 08:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbjJKMej (ORCPT ); Wed, 11 Oct 2023 08:34:39 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA71D98; Wed, 11 Oct 2023 05:34:37 -0700 (PDT) Date: Wed, 11 Oct 2023 12:34:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697027676; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lRLz5u7rlrapgnDTjt3gDSupwa+PRH+Rw4WNxZmPyb0=; b=n4QIALyduIPB0kM7M3PRjriO1TAVy74sewCk4A4ETc2hHgTmEcyC1J7avZJ01NxM/Qvi7e bxxnCg1QP26BET9dQN9VJsMuHPYXry+MvXGAaq94f+d6UjzGgmLmb3E2ZkacxQkOnIXo/A KMVnsK1XjJDGkXWI19Fg2Q3zi1w5JOvPBZcg9b+6//le3OioYh/JxAYJH4evUVHNXlT4ZX CfrLdEAeRbps1Pas6uRMlX1vmsje/XyhP5UnwDS4MXa9aSjdPwPblsNsNhak/76eL0Ui9p Dbc+s2eY8a9mZx7xeqqwEQ1l519L1vTH3JIm0JYT+S9VoWsNuI8nWRaS97Fwqg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697027676; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lRLz5u7rlrapgnDTjt3gDSupwa+PRH+Rw4WNxZmPyb0=; b=WiuildRm7y+0w0UUy4xm6Jab8uTEDXZvt9ZMJ82ds0BNHaMNc0EvhQDaRmoSdeTKRHylPR 262tShZ5j7Rn4CCA== From: "tip-bot2 for Russell King (Oracle)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/urgent] cpu-hotplug: Provide prototypes for arch CPU registration Cc: "Russell King (Oracle)" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <169702767511.3135.14022878103064178933.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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]); Wed, 11 Oct 2023 05:34:59 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779462518932264889 X-GMAIL-MSGID: 1779462518932264889 The following commit has been merged into the smp/urgent branch of tip: Commit-ID: c4dd854f740c21ae8dd9903fc67969c5497cb14b Gitweb: https://git.kernel.org/tip/c4dd854f740c21ae8dd9903fc67969c5497cb14b Author: Russell King (Oracle) AuthorDate: Mon, 25 Sep 2023 17:28:39 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 11 Oct 2023 14:27:37 +02:00 cpu-hotplug: Provide prototypes for arch CPU registration 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, do the job once for everyone. Since this covers everyone, remove the now unnecessary prototypes in asm/cpu.h, and therefore remove the 'static' from one of ia64's arch_register_cpu() definitions. [ tglx: Bring back the ia64 part and remove the ACPI prototypes ] Signed-off-by: Russell King (Oracle) Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/E1qkoRr-0088Q8-Da@rmk-PC.armlinux.org.uk --- arch/ia64/include/asm/cpu.h | 5 ----- arch/ia64/kernel/topology.c | 2 +- arch/x86/include/asm/cpu.h | 2 -- arch/x86/kernel/topology.c | 2 +- drivers/acpi/acpi_processor.c | 1 + include/acpi/processor.h | 5 ----- include/linux/cpu.h | 2 ++ 7 files changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/ia64/include/asm/cpu.h b/arch/ia64/include/asm/cpu.h index db125df..642d716 100644 --- a/arch/ia64/include/asm/cpu.h +++ b/arch/ia64/include/asm/cpu.h @@ -15,9 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices); DECLARE_PER_CPU(int, cpu_state); -#ifdef CONFIG_HOTPLUG_CPU -extern int arch_register_cpu(int num); -extern void arch_unregister_cpu(int); -#endif - #endif /* _ASM_IA64_CPU_H_ */ diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index 94a848b..741863a 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c @@ -59,7 +59,7 @@ void __ref arch_unregister_cpu(int num) } EXPORT_SYMBOL(arch_unregister_cpu); #else -static int __init arch_register_cpu(int num) +int __init arch_register_cpu(int num) { return register_cpu(&sysfs_cpus[num].cpu, num); } diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h index 3a233eb..25050d9 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 ca004e2..0bab031 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/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index c711db8..0f5218e 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -12,6 +12,7 @@ #define pr_fmt(fmt) "ACPI: " fmt #include +#include #include #include #include diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 94181fe..3f34ebb 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -465,9 +465,4 @@ extern int acpi_processor_ffh_lpi_probe(unsigned int cpu); extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi); #endif -#ifdef CONFIG_ACPI_HOTPLUG_CPU -extern int arch_register_cpu(int cpu); -extern void arch_unregister_cpu(int cpu); -#endif - #endif diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 0abd60a..eb768a8 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);