Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3959028rdb; Thu, 14 Sep 2023 07:51:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUPZFOxTGVHItvk6yy7hx+kDMTR6mg1wLytYKNtKg8lPBLo75jjskR9XD+g0fTSuYnY2hx X-Received: by 2002:a05:6a20:4327:b0:13b:b4bb:8b18 with SMTP id h39-20020a056a20432700b0013bb4bb8b18mr6851363pzk.1.1694703062989; Thu, 14 Sep 2023 07:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694703062; cv=none; d=google.com; s=arc-20160816; b=jG1EGBoMDsX0sMrPVbBcaJhP8L9vYpv3yk5/JSa2wUELYlMlQbTyyWUc+SnvuHBRPf uSO73chNUlADMGXLejZyHgXwRi7iqXyyXBCrCZM2PIQdxDP4+b7otJZ9xsckcFW5x3Ku 2/gWsloVD/mg4Be5ynW5QuZKlzYRkc/y2suVVUn9QSqvJj18RGSpzOsz7M2QZrzF+Qoy Z+SfL4VPM7V2/a5wuI4VebO7BuMYdgvzECsytAbnyTzUvAm6JgESMFxqbklGRWcIhcou bKwIrAAFEBoL4Nup7/oFIwF6pOUzL7dt1zpGJhj1psBr7j0AOftAhbQYqXjklOoo0YUo 5hdg== 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=kfX0iPie/MNth9Elm+Gpu6Z1WSTIMbo0NFH2I9zRbPo=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=Ytwv9Hy4/ZLOZXIcLHrbpdkYbPb0sZCj6SPJVUeMy8C6lsxO1b/3hyO9hsommwzAMJ QbBmPn1s67o6WhUjJW+9RB4IguG21jCVo6QTijuwosVYJ7oNfVqh0RdSJGlpyMKkbyLD tYo767Q9DrPziemCUvNtTSrp72ZnE/vX/RmoTN6heu1YnIPnEyDkNhd5CoI3dpIRFCCH z3grB/EUg59nfifS7fbPFpguPvWwR46y1MMN7VX9t76/R2ShUOz3Hnu4IyG+1JvnGRxe jNm8XKCtt66ud6CZruR8oYlF2nnPNNEqylECF7SVkJtem9kjb6OxsWuKe3FVdAVpj+bW jHjg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id eg14-20020a056a00800e00b0068fb8fa1e71si1698280pfb.207.2023.09.14.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 07:51:02 -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; 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=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 howler.vger.email (Postfix) with ESMTP id DF1D7807D8DB; Thu, 14 Sep 2023 07:41:20 -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 S240231AbjINOlU (ORCPT + 99 others); Thu, 14 Sep 2023 10:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240273AbjINOlS (ORCPT ); Thu, 14 Sep 2023 10:41:18 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EEDE1BE1; Thu, 14 Sep 2023 07:41:14 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rmfyl2yvtz6J7Pn; Thu, 14 Sep 2023 22:36:31 +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:41:12 +0100 Date: Thu, 14 Sep 2023 15:41:11 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 25/35] LoongArch: Use the __weak version of arch_unregister_cpu() Message-ID: <20230914154111.0000189d@Huawei.com> In-Reply-To: <20230913163823.7880-26-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-26-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 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 07:41:21 -0700 (PDT) On Wed, 13 Sep 2023 16:38:13 +0000 James Morse wrote: > LoongArch provides its own arch_unregister_cpu(). This clears the > hotpluggable flag, then unregisters the CPU. > > It isn't necessary to clear the hotpluggable flag when unregistering > a cpu. unregister_cpu() writes NULL to the percpu cpu_sys_devices > pointer, meaning cpu_is_hotpluggable() will return false, as > get_cpu_device() has returned NULL. Thought that looked odd earlier but didn't care enough to dig. Seem unlikely state would persist for an unregistered cpu. Great to see confirmation. > > Remove arch_unregister_cpu() and use the __weak version. > > Signed-off-by: James Morse Reviewed-by: Jonathan Cameron > --- > arch/loongarch/kernel/topology.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/arch/loongarch/kernel/topology.c b/arch/loongarch/kernel/topology.c > index 8e4441c1ff39..5a75e2cc0848 100644 > --- a/arch/loongarch/kernel/topology.c > +++ b/arch/loongarch/kernel/topology.c > @@ -16,13 +16,4 @@ int arch_register_cpu(int cpu) > return register_cpu(c, cpu); > } > EXPORT_SYMBOL(arch_register_cpu); > - > -void arch_unregister_cpu(int cpu) > -{ > - struct cpu *c = &per_cpu(cpu_devices, cpu); > - > - c->hotpluggable = 0; > - unregister_cpu(c); > -} > -EXPORT_SYMBOL(arch_unregister_cpu); > #endif