Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4211317rdb; Thu, 14 Sep 2023 15:43:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFa1lN8Fv9fOGRo62ldBEHnRSnjlBDcS4GwoZbsJi/1/ZeJqcXdj9c1o8MbwWsVqFsBG8Ky X-Received: by 2002:a05:6a20:8f11:b0:133:6e3d:68cd with SMTP id b17-20020a056a208f1100b001336e3d68cdmr112772pzk.3.1694731418803; Thu, 14 Sep 2023 15:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694731418; cv=none; d=google.com; s=arc-20160816; b=rJlinTm45R9QT6XSMz1XXdWkJ9uz+qVJmu1QMsbbM/DJgjsjbSy2BhLCc/BsuOi3oh IDKaccYBi4qGAwrJD0T+7efgNVhHbXtBmiz87mv9oymKUnj6pbe8aakh7Kg9GQoy2GhU x0UgI5Jacl9JmnYriUfRhuG3Nsw/p3szNmC+0WZTx4x7FxQcPCq+2cD4+spfS5LUGzS2 lRj1PV+vy+l+yK2pihmIBOm801ASij1B05/uvVc+Va7sxU5yV3RaJqeVsEpMrHyDDIlf DTDS9xHNcyUAXDdqLxqzqVkuYvSrD0wDpS+rUrTB76OkBj6uGZgSB3sGZ/nfzmACjuwR GYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=W1b9F59Hb1yi0CL0L9HGKRu4vK5LEtTICVKixKZjsJc=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=rdIV/ld8MzZbB4gtL9HcEaq4DNKeQDPLOU2aFcCkJcG9hXMpXxdDYxX1r/D0YZtFqk ZmJ5MCadblkBk+MWDpkjIopMcV4jqKjSsir+cONBxBjD+x0f1utzsEhC3ArJrZr7/GWP iODRrRuEdTNxjrKkC5R3xBo/1glmuVZZc1H6g6tJPfTpRuedSO2kYQjbdSxEbSdgIHym 4yUVpn4pPPxypL9d6V7H7VtDwLjLa4mxbRtt0tx12wiJKhWJBON1J2cZNtSC9fXZxvix EJmw3KWjjaUTT0hMRCRBkrkngWkttH6G77Ni4h9kd785zTTju+KLzsCrSr6xBeaxtayp Mi6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w20-20020a63fb54000000b00557447d5721si2086971pgj.768.2023.09.14.15.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 15:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6B0448315555; Thu, 14 Sep 2023 07:39:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240188AbjINOj1 (ORCPT + 99 others); Thu, 14 Sep 2023 10:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238205AbjINOj0 (ORCPT ); Thu, 14 Sep 2023 10:39:26 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B561A5; Thu, 14 Sep 2023 07:39:21 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rmg1G5Xz2z6K5p0; Thu, 14 Sep 2023 22:38:42 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 14 Sep 2023 15:39:18 +0100 Date: Thu, 14 Sep 2023 15:39:18 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 24/35] drivers: base: Implement weak arch_unregister_cpu() Message-ID: <20230914153918.00004c92@Huawei.com> In-Reply-To: <20230913163823.7880-25-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-25-james.morse@arm.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected 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 (snail.vger.email [0.0.0.0]); Thu, 14 Sep 2023 07:39:26 -0700 (PDT) On Wed, 13 Sep 2023 16:38:12 +0000 James Morse wrote: > Add arch_unregister_cpu() to allow the ACPI machinery to call > unregister_cpu(). This is enough for arm64, riscv and loongarch, but > needs to be overridden by x86 and ia64 who need to do more work. > > CC: Jean-Philippe Brucker > Signed-off-by: James Morse Ah. Was thinking this should happen in an earlier patch. Reviewed-by: Jonathan Cameron > --- > Changes since v1: > * Added CONFIG_HOTPLUG_CPU ifdeffery around unregister_cpu > --- > arch/ia64/include/asm/cpu.h | 4 ---- > arch/loongarch/include/asm/cpu.h | 6 ------ > arch/x86/include/asm/cpu.h | 1 - > drivers/base/cpu.c | 9 ++++++++- > 4 files changed, 8 insertions(+), 12 deletions(-) > > diff --git a/arch/ia64/include/asm/cpu.h b/arch/ia64/include/asm/cpu.h > index a3e690e685e5..642d71675ddb 100644 > --- a/arch/ia64/include/asm/cpu.h > +++ b/arch/ia64/include/asm/cpu.h > @@ -15,8 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices); > > DECLARE_PER_CPU(int, cpu_state); > > -#ifdef CONFIG_HOTPLUG_CPU > -extern void arch_unregister_cpu(int); > -#endif > - > #endif /* _ASM_IA64_CPU_H_ */ > diff --git a/arch/loongarch/include/asm/cpu.h b/arch/loongarch/include/asm/cpu.h > index b8568e637420..48b9f7168bcc 100644 > --- a/arch/loongarch/include/asm/cpu.h > +++ b/arch/loongarch/include/asm/cpu.h > @@ -128,10 +128,4 @@ enum cpu_type_enum { > #define LOONGARCH_CPU_HYPERVISOR BIT_ULL(CPU_FEATURE_HYPERVISOR) > #define LOONGARCH_CPU_PTW BIT_ULL(CPU_FEATURE_PTW) > > -#if !defined(__ASSEMBLY__) > -#ifdef CONFIG_HOTPLUG_CPU > -void arch_unregister_cpu(int cpu); > -#endif > -#endif /* ! __ASSEMBLY__ */ > - > #endif /* _ASM_CPU_H */ > diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h > index f349c94510e8..91867a6a9f8e 100644 > --- a/arch/x86/include/asm/cpu.h > +++ b/arch/x86/include/asm/cpu.h > @@ -24,7 +24,6 @@ static inline void prefill_possible_map(void) {} > #endif /* CONFIG_SMP */ > > #ifdef CONFIG_HOTPLUG_CPU > -extern void arch_unregister_cpu(int); > extern void soft_restart_cpu(void); > #endif > > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c > index 677f963e02ce..c709747c4a18 100644 > --- a/drivers/base/cpu.c > +++ b/drivers/base/cpu.c > @@ -531,7 +531,14 @@ int __weak arch_register_cpu(int cpu) > { > return register_cpu(&per_cpu(cpu_devices, cpu), cpu); > } > -#endif > + > +#ifdef CONFIG_HOTPLUG_CPU > +void __weak arch_unregister_cpu(int num) > +{ > + unregister_cpu(&per_cpu(cpu_devices, num)); > +} > +#endif /* CONFIG_HOTPLUG_CPU */ > +#endif /* CONFIG_GENERIC_CPU_DEVICES */ > > static void __init cpu_dev_register_generic(void) > {