Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1583416rdh; Mon, 25 Sep 2023 18:30:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGh9k8nVcQIqma1bS1Tx1IWuWzHnsBGt21t14eGdpJgcnlVRfc+kiA1hbX21GjKmRmelmRH X-Received: by 2002:a05:6358:52d2:b0:140:f00a:ee2d with SMTP id z18-20020a05635852d200b00140f00aee2dmr11227013rwz.23.1695691814190; Mon, 25 Sep 2023 18:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695691814; cv=none; d=google.com; s=arc-20160816; b=PYszH3TmIm7S5g/m5cqdWxtWZ6k8UcrwceaSzZyXLdt4Sfp42f6C+TkJja7zoq+LnK F4h8Sl5Q+cuBOJUABvqhjrt9M/e/eHlNGdGt4+NEAvYLEYfqXNiesn01ojVSsZjREljR jLZ/+h6+9qcrp0Y55xwIU46Yo4ZSVk4lK0a2+ryJ7L1MJAc6I6YggcuUtIUdGsGPnGO+ JzPJ60I2J1BBEQVOqgxASKA8KSrd5nwVrsDL40KrkTdaYF/4IoV/6kFh/t3OiUte5hCx hg2vVy8ee4ipFuWHPtuv+upa1YoMykIH9a5AqI2Sf+ZK9L0jGDowSriF4Y7hYg/SQocO MXyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=swf/1TRyjsvwDIsd/YLqft6nJR4VSEYvlPbm2UeV+EA=; fh=UzklaqYf9fqQD7mHifBxWqbFob9iYjryK+PPWM9N428=; b=qzhfKrm34hacwAlkm8VUz2fw+pbrue2lR8TgChv2okw2rufF3UUruRkC8gEz8q7Bm5 drMsIduQpFTufO6SlAhgzyAmCjjf3qSCBJva8Q2bYPj6Be/DwSdmDVnk7JOY98BM+EKP 7o9kgL1aHAx3RSwiB4RpOzRvbNOxpRPjLXiakiFBZ/s+NeLRhEp0DXKxWmZze8lJZdWB gUGoErY1gnvYdMg0xELB9VGYC8CKMmz/7Gd4HqP5nJIVD60XlI/b913hwqqXx7+VpV0w QOaIXEI40VgJRm03wMnb06kkaZylayaaW9PMS1J5riTzIWm5y9tNTGVTBwWOY79YNhtL Jxrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ACE2clBY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bt8-20020a632908000000b0057762236debsi11204178pgb.546.2023.09.25.18.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 18:30:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ACE2clBY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 52539830D348; Mon, 25 Sep 2023 16:05:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbjIYXFw (ORCPT + 99 others); Mon, 25 Sep 2023 19:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbjIYXFv (ORCPT ); Mon, 25 Sep 2023 19:05:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E268F11C for ; Mon, 25 Sep 2023 16:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695683099; h=from:from: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=swf/1TRyjsvwDIsd/YLqft6nJR4VSEYvlPbm2UeV+EA=; b=ACE2clBYMwPwRN/Udi+a+n/5AYXneaa8jPFe5vInkIA2kLbzxvsPZMb7IaSxVY7Xgh/7WG 1fqG8bCiFBABXHTAuK3ALLjdPwTQBa8I2RTTXUHx/+n1tA7hqGwQdVxcER9dKX/w8Cnysq S0BnsfydmkrxD36Wpr0MVGJjBHBC02c= Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-13-09PnBgJ3PriYS3TguF_NOQ-1; Mon, 25 Sep 2023 19:04:57 -0400 X-MC-Unique: 09PnBgJ3PriYS3TguF_NOQ-1 Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-1d6fdbe39c8so16666500fac.2 for ; Mon, 25 Sep 2023 16:04:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695683097; x=1696287897; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=swf/1TRyjsvwDIsd/YLqft6nJR4VSEYvlPbm2UeV+EA=; b=YE6153NGbWCns3mfAzmevCx6JePoWYKmRIDf1/McJBVf2aSFex1UiUuwmYUmL23Iam lm2Tbzi8A+3+l47KFmspV5xTShWN5qS1M0XwaZxgMW39ZslTALIVAJR4pzWDrFEbkwr9 LRkA+I98f/aeFL+8eZkXEL6FIEJjaHNHrr6Imhw84sG52Sh2HTB2s3uzK1QWs3drso3A ccLa8HQ6434hX2XqOZUTLqvPsrQaQQJBI3F6sGt07uEnYGD17UPwHxuO9VUAkfFLlLBe bM4ws4dj2MoyM08CDrumxcPO/zMSVsbZr6tfVJcMKZcI3dejsjbWwySsWXJFAkXcrg4B JalQ== X-Gm-Message-State: AOJu0YybN2pd26RTbAB6eDENZroi6SM9F6d0RX/QVtjuetAwGbln+9SI tqJpOUVYts+qv7CdPajUJ5P+NyhKvzEhqEZHPeBQu4N/+Eaz+8BkMbvdrPmnQPTr8AZeg65wOLb 2oY4kOs1k8VV8hao3oExB5IBg X-Received: by 2002:a05:6358:2823:b0:135:47e8:76e2 with SMTP id k35-20020a056358282300b0013547e876e2mr11329973rwb.4.1695683096744; Mon, 25 Sep 2023 16:04:56 -0700 (PDT) X-Received: by 2002:a05:6358:2823:b0:135:47e8:76e2 with SMTP id k35-20020a056358282300b0013547e876e2mr11329948rwb.4.1695683096324; Mon, 25 Sep 2023 16:04:56 -0700 (PDT) Received: from ?IPV6:2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5? ([2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5]) by smtp.gmail.com with ESMTPSA id z27-20020a637e1b000000b00563e1ef0491sm8538475pgc.8.2023.09.25.16.04.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Sep 2023 16:04:55 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2023 09:04:46 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] cpu-hotplug: provide prototypes for arch CPU registration Content-Language: en-US To: "Russell King (Oracle)" , 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 , "H. Peter Anvin" , Peter Zijlstra , linux-ia64@vger.kernel.org References: From: Gavin Shan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 16:05:53 -0700 (PDT) Hi Russell, On 9/26/23 02:28, Russell King (Oracle) wrote: > 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(-) > In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h. They may have been dropped in other ia64 or x86 git repository, which this patch bases on. In the commit message, 'static' from one of ia64's arch_register_cpu() definitions is removed, but there is no changes related to ia64 in this patch. I guess that's probably x86? > 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); > } I think arch/ia64/kernel/topology.c may need same change, as stated in the commit log. In linux 6.6.rc3, 'static' exists in arch/ia64/kernel/topology.c::arch_register_cpu(). Again, your patch may have been based on other git repository. > 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); Thanks, Gavin