Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6176164rdb; Thu, 14 Dec 2023 10:11:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IECkthpgz59Sx/NHr4xQ/PNG8vcGr/4258CEXQELMDeOISqolDilVWEuGSiqBzRDO5vDL5k X-Received: by 2002:a17:902:6f0f:b0:1d3:71df:e0b2 with SMTP id w15-20020a1709026f0f00b001d371dfe0b2mr838660plk.99.1702577472995; Thu, 14 Dec 2023 10:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702577472; cv=none; d=google.com; s=arc-20160816; b=ilExLdeHytwxGoZs/twJaJimMiexVe/yBXQslPJOdumuoQcjkicZILCNpzIT1peQf/ BFkzyv/wboFSJFHY5P8eyaqRYK5TAsnokhWslOltYlfuyr3TmLUUA4Y0z5jXaz8SSOAI d6w2wbfASUP/iNAvSVyuN4t8/efWWA7URNvHNIq6RRoEfktEBgX49eB+KhS8c3sw2mMj UrH66RaMngVT1k0nA4Mp0deup3nBiP1xw56VINvZZnyksPa4EPf+K4KCCjVYRg5gRJED 3/puAf03v9UuphXAm9kP06vFDSXYstJmSsfFyAtjqTGkUi5yQJF1ShJCpVXVxcCJ8YXh oUBw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=F6v3AKzs82rkOxn7Bw7IYQ7aZOZcvY0R37BDizdoEeM=; fh=jk49YxFvkeKEe21V4UzhmJ9WhP6xdFgUEwa1GfJNKdo=; b=VvpiWg6gQ+DH92IpZ3GrvtulUyL71f2mh2/icJ2O55p6tKRI5hwuWCaRKdS/ZDBWch RcMK64m63KlwOuQW7J+D9PkhuFsJNdxSv8f6YdwcdHT7LqFque5EfE5iU2gQhaOXY8qW 4ABxMWdC/2RrmiMwT6z35MS7LJ6Se5lqoxn57ZeVUKTbWdf8wKh79Y8hY+FJiGzGJax3 ze65mja8aMZ8kMiGzQXBvOiwiC+V/Xl+bRZ8DizSp+PLCwUmMpQ4JLB8NAHYS1qkjDxR xjf7cK4YWboHchpGq9YwuAZvmk+4AEsB6KAztVSeeo7En35wVdnyd2DKuIsNSzdBx8to k1KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tY1PZOXl; 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i3-20020a170902c94300b001cffce3a2e2si11910908pla.426.2023.12.14.10.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 10:11:12 -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=tY1PZOXl; 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 7B6C38053C3A; Thu, 14 Dec 2023 10:10:33 -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 S1444191AbjLNSKP (ORCPT + 99 others); Thu, 14 Dec 2023 13:10:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235736AbjLNSKO (ORCPT ); Thu, 14 Dec 2023 13:10:14 -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 DDD8B10A; Thu, 14 Dec 2023 10:10:19 -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-Transfer-Encoding:Content-Type: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=F6v3AKzs82rkOxn7Bw7IYQ7aZOZcvY0R37BDizdoEeM=; b=tY1PZOXlkxfPhC2ytAtA0EChgV 8xCikVzwQf/d2ei3BQiYpgHklnc1tZ55NIOKpAXSmHbLYqZAbjznFALBKmUxTrM4w2RITv7a7Q6XV 8XubzTsdDZhxlotwEGrTMzdgUb1Yg7n7Iz5rqFqo47poHwJ4ccKf3791BCJtbXIwi8MIlAzn1uWTE OOYF2o+5Hj7dg2UbMDFo2mAQX/FDQEqk8jY8NDjlNrtMtGVSQ16JC/qnqo216nVBiSVzT5rfswiQP CqIDdHbL71hGf6tFcrchFr7OZ0y0UeWzp4gUjEYw/EhCnmIE43HhXw9gXHQ3o86quWAXEeKRp0wEP IVtRjJdA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55476) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDqA1-0001pW-1e; Thu, 14 Dec 2023 18:10:13 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDqA2-0002m4-0s; Thu, 14 Dec 2023 18:10:14 +0000 Date: Thu, 14 Dec 2023 18:10:13 +0000 From: "Russell King (Oracle)" To: "Rafael J. Wysocki" Cc: Jonathan Cameron , 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 10:10:33 -0800 (PST) On Thu, Dec 14, 2023 at 06:47:00PM +0100, Rafael J. Wysocki wrote: > On Thu, Dec 14, 2023 at 6:32 PM 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. > > A chicken bit wouldn't help much IMO, especially in the cases when > working setups get broken. > > I would very much prefer to limit the scope of it, say to processors > only, in the first place. Thanks for the feedback and the idea. I guess we need something like: if (device->status.present) return device->device_type != ACPI_BUS_TYPE_PROCESSOR || device->status.enabled; else return device->status.functional; so we only check device->status.enabled for processor-type devices? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!