Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6164500rdb; Thu, 14 Dec 2023 09:55:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNBwskwtnGEexIAzx4VXwomQJp3XWivrKfc/M2lKHb5rw6VRTEM5RYEK3766w4yOH+N7UP X-Received: by 2002:a17:90a:ca14:b0:28a:c720:e60e with SMTP id x20-20020a17090aca1400b0028ac720e60emr2407182pjt.66.1702576540684; Thu, 14 Dec 2023 09:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702576540; cv=none; d=google.com; s=arc-20160816; b=QvvYzjONNOrsJNBpibjpWFcXlaFumpsaVii3Frt4nwTuWpviYneHZAD9lWzKyecAKU 9gQQOt0NpuFJYeJxH3jSYnTiC60/okV8vOGYd+1qtzF5BUsv3l8sb8H9fcab5nPcUkZn Jvjp5PyOwc2dQlphhw4eSmftMKV9WbH5Ja6q6HUcxBj3cQUG4PJ7LhMevXNuDw72jhp0 2/nJb7G92SRwGubKCsObHMMCAJL+mccHXflKDUW2ZaDp9cq3H1ncpjdEdyfP6JM5fc2L OHL9C+AZkFjO6Xo2Xizccgha+JUnEWupGWENNlleynrIvKLc9zDR2xrAcvknefpIplr1 mwkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yZZfFiLwNQEGOTfqPZeYqFsQFPoC9cJyPHRCME7+qng=; fh=P5zBB1N/HVmDFriWCJ6Qffp6bP+zgT4BB6XzwIQk2no=; b=uZOmR+VG8ZXeIHipErdR/taFPhFaENud7AJ7ITkzuif9U9lBPpcvUfwmw8tby0H3ND Lz0xi5FrAoTRo6umn0roBGIgf8D5Ogk52cjQuro72HYUQ5kWhS1YhGgdMELBJGh+dOqu UbxNGvxloxCTnojCuvnheYSijf1jrYAyu2fivxKQhedjcgGeQtsEM1ln0tqidCFasIWb pySWnuGrGFEoK7/IQSyhtNgPEX0yx5cN3MkDpMxa9l1WreoeYg7gPLtPqz8CkhRSHyzR rsrEw9JB7w3xb1zKlsMfGI4jJv4gAuxvxwer26scec46/dqk3lRPVNhAQMkKqaVVoNUY H2OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=YZln1QZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id qa1-20020a17090b4fc100b00288895dd81csi12165071pjb.59.2023.12.14.09.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 09:55:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=YZln1QZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id AC9D181C3D6C; Thu, 14 Dec 2023 09:55:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231334AbjLNRzQ (ORCPT + 99 others); Thu, 14 Dec 2023 12:55:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjLNRzP (ORCPT ); Thu, 14 Dec 2023 12:55:15 -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 89EDDA6; Thu, 14 Dec 2023 09:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=yZZfFiLwNQEGOTfqPZeYqFsQFPoC9cJyPHRCME7+qng=; b=YZln1QZxhDK9MAc+S2Xd9heAgy ie5lPli0BDZIk0s28NjnJCpwz3RwdjpjdXrpc+br3qEiudcMak40U5Z+KZNubTpGCA7kHnccAeNlr Pyd4TFtyk/YlD6xLA3UBo+0SS95CobxPx1j5yl7dW43hlqLWjkB2Gt5g/Q9fQiM4IljnmObep5pma mIgrXVGCHv0cZkuAsz3SmcPEpKVgoVbP/e96BvWTC3xUkbjCiKWCZs/aOpnDnusCNUH4kdYbxSCdM U+6zvJBCblim05E+MMAqmh4KZVohjAhWk/AvdEovz1W7UBINZht7JDprgbbiomQQV/JJWQXrhLWtO JcUuFF2w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45686) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDpvX-0001ns-17; Thu, 14 Dec 2023 17:55:15 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDpvW-0002kf-Sv; Thu, 14 Dec 2023 17:55:14 +0000 Date: Thu, 14 Dec 2023 17:55:14 +0000 From: "Russell King (Oracle)" To: Jonathan Cameron Cc: 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, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse Subject: Re: [PATCH RFC v3 01/21] ACPI: Only enumerate enabled (or functional) devices Message-ID: References: <20231214173241.0000260f@Huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214173241.0000260f@Huawei.com> Sender: Russell King (Oracle) 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 fry.vger.email 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 (fry.vger.email [0.0.0.0]); Thu, 14 Dec 2023 09:55:37 -0800 (PST) On Thu, Dec 14, 2023 at 05:32:41PM +0000, Jonathan Cameron wrote: > On Wed, 13 Dec 2023 12:49:16 +0000 > Russell King (Oracle) wrote: > > > From: James Morse > > > > Today the ACPI enumeration code 'visits' all devices that are present. > > > > This is a problem for arm64, where CPUs are always present, but not > > always enabled. When a device-check occurs because the firmware-policy > > has changed and a CPU is now enabled, the following error occurs: > > | acpi ACPI0007:48: Enumeration failure > > > > This is ultimately because acpi_dev_ready_for_enumeration() returns > > true for a device that is not enabled. The ACPI Processor driver > > will not register such CPUs as they are not 'decoding their resources'. > > > > Change acpi_dev_ready_for_enumeration() to also check the enabled bit. > > ACPI allows a device to be functional instead of maintaining the > > present and enabled bit. Make this behaviour an explicit check with > > a reference to the spec, and then check the present and enabled bits. > > This is needed to avoid enumerating present && functional devices that > > are not enabled. > > > > Signed-off-by: James Morse > > Tested-by: Miguel Luis > > Tested-by: Vishnu Pajjuri > > Tested-by: Jianyong Wu > > Signed-off-by: Russell King (Oracle) > > --- > > If this change causes problems on deployed hardware, I suggest an > > arch opt-in: ACPI_IGNORE_STA_ENABLED, that causes > > acpi_dev_ready_for_enumeration() to only check the present bit. > > My gut feeling (having made ACPI 'fixes' in the past that ran into > horribly broken firmware and had to be reverted) is reduce the blast > radius preemptively from the start. I'd love to live in a world were > that wasn't necessary but I don't trust all the generators of ACPI tables. > I'll leave it to Rafael and other ACPI experts suggest how narrow we should > make it though - arch opt in might be narrow enough. Yes, I think an arch opt-in would be the most sensible way forward, if Rafael concurs with that idea. I notice that what I wrote there was actually an opt-out. I'll fix that. > > + /* > > + * ACPI 6.5's 6.3.7 "_STA (Device Status)" allows firmware to return > > + * (!present && functional) for certain types of devices that should be > > + * enumerated. Note that the enabled bit can't be sert until the present > > set until Thanks for spotting that, fixed. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!