From patchwork Wed Dec 13 12:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 177966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7749539dys; Wed, 13 Dec 2023 04:51:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFB/oZt8Y9x6QTiBx5ngRveszBgoV1A3aBNrUYIRyGeTlCCnSswv1As4/Iv06MIkCSs9TiW X-Received: by 2002:a05:6870:c69d:b0:1fa:ecf1:8b62 with SMTP id cv29-20020a056870c69d00b001faecf18b62mr10032882oab.26.1702471862727; Wed, 13 Dec 2023 04:51:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702471862; cv=none; d=google.com; s=arc-20160816; b=kxP/szWlI+Efw7Fh1Htxrd2dhu9ilJ6SNLmRbV8m8A6r6qhomJhC16yXxBxr2ZeAIH YXKX4cvmFLGuPdPuJYzoFSAcVK3rLZP1aq/pEZsdVtMNoAVVLMd9Fwto3/Qb9ae2XJC2 SjOh+tpN5E3tTwjfw4RQs6LuM6Jnae0DIPSjTg0PLu1DwFKlZlMsXZpf/FDj57nzQbo8 B5caDlEieyLwKiMoeCbJa6bZe8N/xUI0E8fthhPgMD3FmUHUgmYb015SfJA5C6ooCW4f lZIVSsihYzhgrkSiDo4jrsXyHSFWF9JTkkQGdDpY/8CNxR6rb4orcA+we8WgEGl7qQUw yTaw== 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=xRMKGWwlt+tDnJgmpjIjTzFwGAKGxwsQWsjqqxoBgt4=; fh=YWIBRcP8cdLYR894sEToaan3lN1VSUITe+B678IO0WY=; b=08ITE/27DxRC+lwvO2P1N0jwPBWUrfbZN1WpxH3un41c6HQ5/MrThHjcuLH/F8pxLB ycm+l5x49dZgXV4fVQFKh5PUXndSif5H6vpKfn7S3pvMnDX5VfovZ3vXzrULoPtwFfd0 TAEmU5Bbh+I6ip0QGk/2efJ/q63wFsgtDpe5ct+kB3CG4lChneflT1PGMXRKzJi2XnPh lyokbNfXy7uC950KXaRi4u1mGZYVaiIzDSpPjHbdkla3qZApYhFBPzUZvNAgOPwwar7d h2vAKRYNoFniPq0BXqbfMjo0iAnHAvKkOZPQRFM/wZINxtW1vEEdM7D9h6X7YVqU8cyq KAAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="sAvIu/Kf"; 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d3-20020a056a0010c300b006bd360e70edsi9590083pfu.103.2023.12.13.04.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:51:02 -0800 (PST) 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="sAvIu/Kf"; 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 B315280C110D; Wed, 13 Dec 2023 04:51:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378978AbjLMMue (ORCPT + 99 others); Wed, 13 Dec 2023 07:50:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379008AbjLMMuR (ORCPT ); Wed, 13 Dec 2023 07:50:17 -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 0DDBB182; Wed, 13 Dec 2023 04:50:12 -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=xRMKGWwlt+tDnJgmpjIjTzFwGAKGxwsQWsjqqxoBgt4=; b=sAvIu/KfdRhiVQLQAzi1pftBLD AZtA0Hs5SOUW3Khxxl6f/hWMpFepsEJgQyGqVCXf2J6iqPGh1irYe61lsvzQauQCuuk+uH3FyHaw7 AvzGgWM+IPItC0K7GAs/xGD92ORf6Skc8i2iWAeY2h5KaO3CYUXJv5yEt7Urk6M+uQaQNv9JbUQDV WhUE9WkIHa4o1Mu0hFaS70ASAxlzFvPz/G7aA7qW+OsLl7PvjXZFeIE6zhxGyqU2kqJAojzd1G5ES +rzSzq86l+CfY2K8inR1g8Pu6l9z/cbz6RWLKJk+7kIqPgRBox16Ks375iUFf7Q9Q5zjcipcX2OP+ dwCo2UTw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:57402 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 1rDOgf-0008FI-2J; Wed, 13 Dec 2023 12:50:06 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDOgh-00Dvkc-U3; Wed, 13 Dec 2023 12:50:07 +0000 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, 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 , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse Subject: [PATCH RFC v3 11/21] ACPI: Warn when the present bit changes but the feature is not enabled MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 13 Dec 2023 12:50:07 +0000 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,T_SCC_BODY_TEXT_LINE 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]); Wed, 13 Dec 2023 04:51:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785171135607087472 X-GMAIL-MSGID: 1785171135607087472 From: James Morse ACPI firmware can trigger the events to add and remove CPUs, but the OS may not support this. Print an error message when this happens. This gives early warning on arm64 systems that don't support CONFIG_ACPI_HOTPLUG_PRESENT_CPU, as making CPUs not present has side effects for other parts of the system. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Tested-by: Miguel Luis Tested-by: Vishnu Pajjuri Tested-by: Jianyong Wu Signed-off-by: Russell King (Oracle) --- Changes since RFC v2: * Update commit message with suggestion from Gavin Shan --- drivers/acpi/acpi_processor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 19fceb3ec4e2..b7a94c1348b0 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -189,8 +189,10 @@ static int acpi_processor_make_present(struct acpi_processor *pr) acpi_status status; int ret; - if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) + if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) { + pr_err_once("Changing CPU present bit is not supported\n"); return -ENODEV; + } if (invalid_phys_cpuid(pr->phys_id)) return -ENODEV; @@ -462,8 +464,10 @@ static void acpi_processor_make_not_present(struct acpi_device *device) { struct acpi_processor *pr; - if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) + if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) { + pr_err_once("Changing CPU present bit is not supported"); return; + } pr = acpi_driver_data(device); if (pr->id >= nr_cpu_ids)