From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61A0CC4332F for ; Thu, 14 Dec 2023 17:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=D78J27Qkpus460Dl/T6v1vE++IrgTpiMNKazW6lqA+A=; b=putFDJj70RR7r4 rBif0Vq1wNhDezz/KYeHke0xjx6sFYTNopqsrULng1EUIqfJyYL/JR/AJ0EEvlvxJ2bj7J/abSk7i EXHOUP4ri3qLwGeR9dawelx4SoOX14xQn0ShnnrgGuVOrdoslK6NWBbpKNJtG0MmSeCpLWWKlTGnI 5QbZJwi3OJULT7dHdVssWYQd7l8XEQ+WoDEqus0lpSni3hqA7ry35InYvL1ov3oVi6sdQagGChVNH 2XVP057xsw8aGYdS5sm2SmufmjvKkcBHCmu1Tq8NhmKxrf/BKH2H79SArdu2ZiN+KhEXZk3NvHfOQ oS0W80eWhOcZbz2cVSrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDpvq-000yhd-0F; Thu, 14 Dec 2023 17:55:34 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDpvk-000ygN-3C; Thu, 14 Dec 2023 17:55:32 +0000 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-Disposition: inline In-Reply-To: <20231214173241.0000260f@Huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231214_095529_032697_6E0B0F89 X-CRM114-Status: GOOD ( 25.06 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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! _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv