[RFC,v3,18/21] ACPI: processor: Only call arch_unregister_cpu() if HOTPLUG_CPU is selected
Message ID | E1rDOhH-00DvlO-UP@rmk-PC.armlinux.org.uk |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7750256dys; Wed, 13 Dec 2023 04:52:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFc6cHX3yZwFimx1P4RDmcH87Uai1ZBVeRNp4prDVra39Z1uae4MzCKtYPlgiiziUXkJKoY X-Received: by 2002:a05:6e02:170e:b0:35d:59a2:2bc with SMTP id u14-20020a056e02170e00b0035d59a202bcmr12214954ill.92.1702471956666; Wed, 13 Dec 2023 04:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702471956; cv=none; d=google.com; s=arc-20160816; b=wosLat9bABToqe5ol51h3PckImmKNclup2wBSeRAg5DgpvXUXUpz5j38V8As4D12U0 DFP793fYz5oK/Tq5v/yKITPBzeJ1wMgzxKLIyHzrDUyFp6hc0TAV3odWlX79gu54bhVA uwJcrOCFHTBcHjfoPQ3UitEjLb31yYHAV6d6bYfROCnyi0cUEAZs58gSfXhuvObyOLM+ Qm+YiAbB8dAIW5e6ijClyh2HUlpCE7aG4OJx1b3k7GlgTLfwdXmX436w+H+6tUU3bRFL QM8+4wIqlU5t8YEjh8MfjbVy5qvP3EuiajrLZyG1tu7BXfdGU7X10cmyhj24uaT1d5eN UuSA== 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=lmtH59uo0RH6OWln4SWiUMu9ATT5+EWsaWDCzIDILMw=; fh=YWIBRcP8cdLYR894sEToaan3lN1VSUITe+B678IO0WY=; b=scbQJVyn+TN+B+mpuWXSn/DbwJJuv7I9Y9yOaxHt4CN2qq/PtsC7EkDnfmkdF50QmS +CjTDC9QgGPCBxEpE5ZV0v73HObpmBg8SbPZ5DCWTM17zUV5U0C8OSZRD3m1Ye1G0g4/ jySRW1n4N1qf0M+IIdFg6Nf/eTuOSFIaJexB468U2FO+Yt241C5tWndJpXDENbe+oZNG +xXvY8awGJg1n1QixItfHLUgZCNNjmJ5SEO7SpzDoE9t28fLikP6KCb3luc/S35oNG+k 1XY6fv8pJU/4tz10rbabr7OZbGac2ySRXnk+fnAgLCgGGNMHQhsBNUlcZycTzRUIB2kh T5jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vjgZ5o4F; 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=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id g9-20020a636b09000000b005c6ef013573si8819922pgc.446.2023.12.13.04.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:52:36 -0800 (PST) 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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vjgZ5o4F; 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=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 howler.vger.email (Postfix) with ESMTP id 7E1C380B6B91; Wed, 13 Dec 2023 04:52:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378948AbjLMMvy (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 13 Dec 2023 07:51:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378967AbjLMMv1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 13 Dec 2023 07:51:27 -0500 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 D40A819A4; Wed, 13 Dec 2023 04:50:46 -0800 (PST) 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=lmtH59uo0RH6OWln4SWiUMu9ATT5+EWsaWDCzIDILMw=; b=vjgZ5o4FgP2eXJBezIZp2zJ0xr t6xOqiS/tNc9Agtr4/gEtULHWFMdo+cMAqDbsj713CNHaHJh2E0IqnABMfHkAOf9zrsn8DfVcJDcA WkPWWZdNLaXZYBdXwmXvxAT4XOzI7++DthIonECZ/hHPO8CCBoK7myVrtmg7BcHy9HoM5Z1D8HRRy EeIGP/Kl3ObL1mjz6SIe0wNRspxRzY3s7YWxE88eF3Uk+9CSW1a2I7yhLMFjyPBF6Unn/nd9LnM7z EhdbIpoz0zO5WdAFp06vz+2/m5mcxpTMeF2HPrsXAVjTO1hJ+KQySmSlpsrEjacXbVpeeo8+7e5uu ck4N+yzw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:51452 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 <rmk@armlinux.org.uk>) id 1rDOhF-0008HS-2A; Wed, 13 Dec 2023 12:50:41 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from <rmk@rmk-PC.armlinux.org.uk>) id 1rDOhH-00DvlO-UP; Wed, 13 Dec 2023 12:50:43 +0000 In-Reply-To: <ZXmn46ptis59F0CO@shell.armlinux.org.uk> References: <ZXmn46ptis59F0CO@shell.armlinux.org.uk> From: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> 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, acpica-devel@lists.linuxfoundation.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta <salil.mehta@huawei.com>, Jean-Philippe Brucker <jean-philippe@linaro.org>, jianyong.wu@arm.com, justin.he@arm.com, James Morse <james.morse@arm.com> Subject: [PATCH RFC v3 18/21] ACPI: processor: Only call arch_unregister_cpu() if HOTPLUG_CPU is selected MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: <E1rDOhH-00DvlO-UP@rmk-PC.armlinux.org.uk> Sender: Russell King <rmk@armlinux.org.uk> Date: Wed, 13 Dec 2023 12:50:43 +0000 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> 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]); Wed, 13 Dec 2023 04:52:24 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785171234247575508 X-GMAIL-MSGID: 1785171234247575508 |
Series |
ACPI/arm64: add support for virtual cpu hotplug
|
|
Commit Message
Russell King (Oracle)
Dec. 13, 2023, 12:50 p.m. UTC
From: James Morse <james.morse@arm.com> The kbuild robot points out that configurations without HOTPLUG_CPU selected can try to build acpi_processor_post_eject() without success as arch_unregister_cpu() is not defined. Check this explicitly. This will be merged into: | ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug for any subsequent posting. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: James Morse <james.morse@arm.com> Tested-by: Miguel Luis <miguel.luis@oracle.com> Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com> Tested-by: Jianyong Wu <jianyong.wu@arm.com> --- This should probably be squashed into an earlier patch. --- drivers/acpi/acpi_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, 13 Dec 2023 12:50:43 +0000 Russell King (Oracle) <rmk+kernel@armlinux.org.uk> wrote: > From: James Morse <james.morse@arm.com> > > The kbuild robot points out that configurations without HOTPLUG_CPU > selected can try to build acpi_processor_post_eject() without success > as arch_unregister_cpu() is not defined. > > Check this explicitly. This will be merged into: > | ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug > for any subsequent posting. > > Reported-by: kbuild test robot <lkp@intel.com> > Signed-off-by: James Morse <james.morse@arm.com> > Tested-by: Miguel Luis <miguel.luis@oracle.com> > Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com> > Tested-by: Jianyong Wu <jianyong.wu@arm.com> > --- > This should probably be squashed into an earlier patch. Agreed. If not Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
On Fri, Dec 15, 2023 at 04:50:09PM +0000, Jonathan Cameron wrote: > On Wed, 13 Dec 2023 12:50:43 +0000 > Russell King (Oracle) <rmk+kernel@armlinux.org.uk> wrote: > > > From: James Morse <james.morse@arm.com> > > > > The kbuild robot points out that configurations without HOTPLUG_CPU > > selected can try to build acpi_processor_post_eject() without success > > as arch_unregister_cpu() is not defined. > > > > Check this explicitly. This will be merged into: > > | ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug > > for any subsequent posting. > > > > Reported-by: kbuild test robot <lkp@intel.com> > > Signed-off-by: James Morse <james.morse@arm.com> > > Tested-by: Miguel Luis <miguel.luis@oracle.com> > > Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com> > > Tested-by: Jianyong Wu <jianyong.wu@arm.com> > > --- > > This should probably be squashed into an earlier patch. > > Agreed. If not > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> I'm not convinced that "ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug" is the correct commit to squash this into. As far as acpi_processor.c is concerned, This commit merely renames acpi_processor_remove() to be acpi_processor_post_eject(). The function references arch_unregister_cpu() before and after this change, and its build is dependent on CONFIG_ACPI_HOTPLUG_PRESENT_CPU being defined. Commit "ACPI: convert acpi_processor_post_eject() to use IS_ENABLED()" removed the ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU surrounding acpi_processor_post_eject, and that symbol depends on CONFIG_HOTPLUG_CPU, so I think this commit is also fine. Commit "ACPI: Check _STA present bit before making CPUs not present" rewrites the function - the original body gets called acpi_processor_make_not_present() and a new acpi_processor_post_eject() is created. At this point, it doesn't reference arch_unregister_cpu(). Commit "ACPI: add support to register CPUs based on the _STA enabled bit" adds a reference to arch_unregister_cpu() in this new acpi_processor_post_eject() - so I think this is the correct commit this change should be merged into.
On Mon, 18 Dec 2023 12:58:07 +0000 "Russell King (Oracle)" <linux@armlinux.org.uk> wrote: > On Fri, Dec 15, 2023 at 04:50:09PM +0000, Jonathan Cameron wrote: > > On Wed, 13 Dec 2023 12:50:43 +0000 > > Russell King (Oracle) <rmk+kernel@armlinux.org.uk> wrote: > > > > > From: James Morse <james.morse@arm.com> > > > > > > The kbuild robot points out that configurations without HOTPLUG_CPU > > > selected can try to build acpi_processor_post_eject() without success > > > as arch_unregister_cpu() is not defined. > > > > > > Check this explicitly. This will be merged into: > > > | ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug > > > for any subsequent posting. > > > > > > Reported-by: kbuild test robot <lkp@intel.com> > > > Signed-off-by: James Morse <james.morse@arm.com> > > > Tested-by: Miguel Luis <miguel.luis@oracle.com> > > > Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com> > > > Tested-by: Jianyong Wu <jianyong.wu@arm.com> > > > --- > > > This should probably be squashed into an earlier patch. > > > > Agreed. If not > > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > I'm not convinced that "ACPI: Add post_eject to struct acpi_scan_handler > for cpu hotplug" is the correct commit to squash this into. > > As far as acpi_processor.c is concerned, This commit merely renames > acpi_processor_remove() to be acpi_processor_post_eject(). The function > references arch_unregister_cpu() before and after this change, and its > build is dependent on CONFIG_ACPI_HOTPLUG_PRESENT_CPU being defined. > > Commit "ACPI: convert acpi_processor_post_eject() to use IS_ENABLED()" > removed the ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU surrounding > acpi_processor_post_eject, and that symbol depends on > CONFIG_HOTPLUG_CPU, so I think this commit is also fine. > > Commit "ACPI: Check _STA present bit before making CPUs not present" > rewrites the function - the original body gets called > acpi_processor_make_not_present() and a new acpi_processor_post_eject() > is created. At this point, it doesn't reference arch_unregister_cpu(). > > Commit "ACPI: add support to register CPUs based on the _STA enabled > bit" adds a reference to arch_unregister_cpu() in this new > acpi_processor_post_eject() - so I think this is the correct commit > this change should be merged into. That or where that change ends up given your earlier suggestion to move that change as well. I find it hard to care as long as the bisection issue is squashed by the change. If we make the code drop out before the build issue is introduced that's fine because we are arguing we shouldn't be running it anyway so such protection is fine if not necessary for build fix purposes. J >
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 5dabb426481f..ea12e70dfd39 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -537,7 +537,7 @@ static void acpi_processor_post_eject(struct acpi_device *device) unsigned long long sta; acpi_status status; - if (!device) + if (!IS_ENABLED(CONFIG_HOTPLUG_CPU) || !device) return; pr = acpi_driver_data(device);