Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6159866rdb; Thu, 14 Dec 2023 09:47:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsW1rkyckRp6z59rmC/xxTA5Qizs8CRGAbVNCXodwkvGYtQdCYaO7hG0h9TtY8TLWie0bJ X-Received: by 2002:a05:6a20:6a03:b0:18f:bd86:ccaa with SMTP id p3-20020a056a206a0300b0018fbd86ccaamr5931271pzk.55.1702576044503; Thu, 14 Dec 2023 09:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702576044; cv=none; d=google.com; s=arc-20160816; b=Uk5jHvMopLGzIvPzGPTHP8RKCfoK2KroDVr29gwqJZ7POQ64wg/crZgAXRm/leHChx fRPGJbnPluPZOYQG2Zw3Zp7awFQpoYnQJnG2t0RUsysBRRuRGL0jq+SblgmNuCNS9Rtu qOZ95GtDnucmO84qbvk8YOtJrPQfH8zF0covKBbWujxoUbFoOoLt1RD4W4LqYczfUzYN ABmzxs2bm/or8+OlUa2SlqkVIF3grbrQdJP0LshZVQ7lfzje4xn9Dhvwv/jo+vm/8dJF OmxVGLfYEkNvnOIJjlfqUVxZr5Zo2beuGmQQxmgy0XeT/NvVK2AhiiIQ5sFewK3Xtelx XEQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=7d++NhDy6DJaYzr8OB2jqv2PIYRkeS8/EESXAwJjkQ0=; fh=LjwC1CKoMIeEedcjfpfRe7s1crW/2mHmSkBocCh4Mpk=; b=tfLF7dA+qq4GE0UBe/N+5ndEjAXhN5Dh6UuXhSscKM5LRInnwAlOL3waMKLJLxlLqH QDyHShNfp9kci4Moxhs6ZSc9AOqBRmdD+xdEUGF2kkN1n0tVLW41gxm+h2V8xd/E8O70 GfgTZTKRjP8PQNHiRRMMQCL0Fk7vAWgOtw6oh1HIjsonKYBJhT++JoCw4GToX0DfZsrC hRKDW02aZvEWdnBpTFzKN0ydQv4sPiJiB58UP+Rph6J4hPWrcCREQX9V1+47a4kmw7OU LtVPHdcVL7TmAZ+hS9HgBJBDjiiQN06iqQ0KA+Kldow/bDH648YtMWvMysbOLVS+jRlr Caxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d3-20020a056a0010c300b006bd360e70edsi11719925pfu.103.2023.12.14.09.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 09:47:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1F5E08072A3C; Thu, 14 Dec 2023 09:47:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbjLNRrH convert rfc822-to-8bit (ORCPT + 99 others); Thu, 14 Dec 2023 12:47:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjLNRrF (ORCPT ); Thu, 14 Dec 2023 12:47:05 -0500 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 615CE99; Thu, 14 Dec 2023 09:47:12 -0800 (PST) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-1fae54afb66so923835fac.1; Thu, 14 Dec 2023 09:47:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702576031; x=1703180831; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jCI4p6q1rK4WR6fVDr3BUQoNcZe5c1Ddy3SGZDHoC9U=; b=Klmfcn32AMwhAyeLRHSA/v31GZ7LSYOARxntno271KwzKolZnOYCBgPyKOw91vpk3z 08sj+xjNNC+RkqbjYKu0IgwVyN2uRiuOENE5NFsuWJDHrqTXWgKTMrrNoA5KtKZVvhCK qWtHNpjNtxzhEKkSB19DSykQD1AYqtKRUgRGNzorf5m8QqSikdaT6FreaKu/vmlHCK54 MBG50p3WpZcvVU91e4Yf2LJcRpj9is408onXplxIO1RXTjfhfjPjkC86mllW2BZc81xU PQ8+8Fj64wuKSwHvd8FB72JVUQra5ag2D2/0l93JVBaK6sEbBqPqPXhaSks+C5AB+RVo uXvw== X-Gm-Message-State: AOJu0Ywm0hQGEi5Rlwgs0uwkSW+kkUpoyzjZYW+btPQpXnWWJWO/QgC3 uUoRV3Tf7hqWbYoyZRsKHGkGWpze9Xly9I1Wi2o= X-Received: by 2002:a05:6870:20b:b0:203:5389:5afd with SMTP id j11-20020a056870020b00b0020353895afdmr1641660oad.5.1702576031481; Thu, 14 Dec 2023 09:47:11 -0800 (PST) MIME-Version: 1.0 References: <20231214173241.0000260f@Huawei.com> In-Reply-To: <20231214173241.0000260f@Huawei.com> From: "Rafael J. Wysocki" Date: Thu, 14 Dec 2023 18:47:00 +0100 Message-ID: Subject: Re: [PATCH RFC v3 01/21] ACPI: Only enumerate enabled (or functional) devices To: Jonathan Cameron Cc: "Russell King (Oracle)" , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 09:47:22 -0800 (PST) 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.