Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1963357rda; Tue, 24 Oct 2023 08:21:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4CZ3rcKy66RIdJlugJaYMcEgcoK24EIoP+hGsuN3gKRS4c1m8gL7Y/fww/ph95D9ZhqPg X-Received: by 2002:a17:902:c949:b0:1c0:d17a:bfef with SMTP id i9-20020a170902c94900b001c0d17abfefmr12424552pla.30.1698160910703; Tue, 24 Oct 2023 08:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698160910; cv=none; d=google.com; s=arc-20160816; b=ceDXmRU9fzvsoQCd5R5Z1W+MpU8pan82l7K0JKjM20CgvrWboMRBVRz3mGPFNuMtYD yaJVlb86gJC8lo8n2BHeiIhfRWg1evyYFOXFupevTMHhPvzobfAHTSxdku7W1UDFOZKc aDwmY7rHi7/ycfPY0zrDj7wIYTnxTEtikUvYiWdYgQ6pujWh3+IL/BROGiXyUb+MjIwl 0ThBRV0Htq7c7fJBdD1kPpIPlW9evl7pXKbcghDsvaMTzwt7LdOhK2Dis7YxPewW5YpH OhHxkfUwpdNWGscGa7G/tRg/vVd/32D2+pgxxIl26Esr9c8QR81bd/9O3fScywc3KCxp 1VHA== 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:references :in-reply-to:dkim-signature; bh=X5Z3Nkf5E4AARS+LHoFvElPsf0E44YGYiNzXX8jAQTI=; fh=l8EFpk7Ei3L85Td2A01hBrINexzBkrfns5u14IZj5lo=; b=DL4A+468NGCGsE54Xa7smqUi9m6HVBO4ruR8LN/iify6Tf7zg2QlBTc01yGZmh/LQ3 5UXLHCfjXU7z4IRR/jVuS8QFvCa54eONsvgNmDtekpjOWoHbrAKf9dyeCanjBb3UI63O DLRJK5jZQ8pE6EIREphznaYbNGJQB37dkFhKZL2fZq/Z8/UzeinmFE/qz0tplmUPCbSt /L7oVusywZbd/NUnx6i90E5ch3F8sBkN0zH5SydxJlHflnIYbmG99qSJmiUtIF9EuVBF qWhCzZUJc/oODibD6dPLJsKh8fTp0XYVHOJME2CpCtSQ7DAQHCjmbteBmgBXqHJozPSN qE/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=KMVeJnaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n4-20020a170902e54400b001c9d66601ddsi8922195plf.162.2023.10.24.08.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:21:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=KMVeJnaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id AF32D802B402; Tue, 24 Oct 2023 08:21:32 -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 S234873AbjJXPVS (ORCPT + 99 others); Tue, 24 Oct 2023 11:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234819AbjJXPT6 (ORCPT ); Tue, 24 Oct 2023 11:19:58 -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 A537910E3; Tue, 24 Oct 2023 08:18:13 -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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X5Z3Nkf5E4AARS+LHoFvElPsf0E44YGYiNzXX8jAQTI=; b=KMVeJnaKKwNEXhfQUmDrES4Snp XVvjqbxfqo6dLoYwamROVwhdcf+ZovVQJI7nDYDGQtcNIXjfIT8e7KsFeto4CPCANkXvu4t9K4Y+g 8EGsTU5QpumHaaHipUSZyR13cFFVehwjO/0SFEc+a9oyQs8c2MGh5V3uwAXUPf7q0fXPquP3hLEJy Yzqs5yQ5uo1f5zI1l2MQZ9XL7/fXlSAGmRdqC0+pVYMp1Z9i9VoONTVYY/uld4OO+hy99c97jEcyL Hniy37vHKdoNG4BwZgaojb/AMgXRdKgZ2qQQjWXVjYQP8wKJN0AeDHybJXL9JPfGFMLw+qJ5Nr0tt HjcFxc7g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:57434 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 1qvJAU-0004SZ-0c; Tue, 24 Oct 2023 16:18:06 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvJAV-00AqR4-LS; Tue, 24 Oct 2023 16:18:07 +0100 In-Reply-To: References: From: Russell King (Oracle) To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Greg Kroah-Hartman , "Rafael J. Wysocki" , Paul Walmsley , Palmer Dabbelt , Albert Ou Subject: [PATCH 23/39] drivers: base: Implement weak arch_unregister_cpu() MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Tue, 24 Oct 2023 16:18:07 +0100 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:21:32 -0700 (PDT) From: James Morse 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 --- Changes since v1: * Added CONFIG_HOTPLUG_CPU ifdeffery around unregister_cpu Changes since RFC v2: * Move earlier in the series --- drivers/base/cpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 6c70a004c198..2b9cb2667654 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) { -- 2.30.2