Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2094130lqt; Mon, 22 Apr 2024 00:46:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFjigYKZBohBRJWUsf6kmpjonAGO1F1kU7LWdEzF+BIRLQAesAribc/UiWSxJhumeHpiC8RAgPXqjqKFw+WLIpUYfC/6ZCrnsIGEB2zA== X-Google-Smtp-Source: AGHT+IEDFDUymZokZcpxk+0iOX2dHbkxEXEtjkc7lbpjDToZZhIYfk0VCZMRMO0Lf9OIRl5oFONV X-Received: by 2002:a05:6808:50:b0:3c4:e8ab:deee with SMTP id v16-20020a056808005000b003c4e8abdeeemr10675114oic.43.1713772001940; Mon, 22 Apr 2024 00:46:41 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t4-20020a639544000000b005dc8a171689si7362323pgn.411.2024.04.22.00.46.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 00:46:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-152897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 77A70284041 for ; Mon, 22 Apr 2024 07:46:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48DDB4F5ED; Mon, 22 Apr 2024 07:45:52 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 588654CE13 for ; Mon, 22 Apr 2024 07:45:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713771951; cv=none; b=Byj04xVsCLPnJJcH4awpqFEm70IJ76pqrb7rEFXBGWFBW+zeZrm6C0rCuy41Qj6ePn3x1K3dbQFPYKQckg9SUvoYorq/3dGwdwBo8KlkP7dR2kc263jPvggLHQdL6AKo0Zu3khQJo/AQC4P+o3WKtHyGLV+GYCU9XiwV/KZU2f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713771951; c=relaxed/simple; bh=0tZUCejrJ79JNWlBVqZKd9V4vKZCGo0VoibkvLVA/P8=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iqyebP9lKA285QplUNKcIRB0YL0LfhH6n833FzRDXtnRnvaS2AtyKTLdgPDzviixL9Kc39UNaYo4juOFXq+jPQy/W7HKtlaEycMvSBq76OFOx17c3kiMxeemWb0E8wrOCoW/c6ST7lqVipghHvzL9B9pLIIpJY13k+6IRZsDeUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-208.elisa-laajakaista.fi [88.113.25.208]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 5482aa03-007c-11ef-a9de-005056bdf889; Mon, 22 Apr 2024 10:45:46 +0300 (EEST) From: Andy Shevchenko Date: Mon, 22 Apr 2024 10:45:46 +0300 To: Bjorn Helgaas Cc: Vidya Sagar , "Rafael J . Wysocki" , Len Brown , Will Deacon , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Frank Rowand , Thierry Reding , Jonathan Hunter , Krishna Thota , Manikanta Maddireddy , Vidya Sagar , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH v7-incomplete 1/3] PCI: Move PRESERVE_BOOT_CONFIG _DSM evaluation to pci_register_host_bridge() Message-ID: References: <20240418174043.3750240-1-vidyas@nvidia.com> <20240421190914.374399-1-helgaas@kernel.org> <20240421190914.374399-2-helgaas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240421190914.374399-2-helgaas@kernel.org> Sun, Apr 21, 2024 at 02:09:12PM -0500, Bjorn Helgaas kirjoitti: > From: Bjorn Helgaas > > Move the PRESERVE_BOOT_CONFIG _DSM evaluation from acpi_pci_root_create() > to pci_register_host_bridge(). > > This will help unify the ACPI _DSM path and the DT-based > "linux,pci-probe-only" paths. .. > +bool pci_acpi_preserve_config(struct pci_host_bridge *host_bridge) > +{ > + if (ACPI_HANDLE(&host_bridge->dev)) { Wouldn't the below looks nicer if you invert the conditional? handle = ACPI_HANDLE(...); if (!handle) return false; ... > + union acpi_object *obj; > + > + /* > + * Evaluate the "PCI Boot Configuration" _DSM Function. If it > + * exists and returns 0, we must preserve any PCI resource > + * assignments made by firmware for this host bridge. > + */ > + obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(&host_bridge->dev), > + &pci_acpi_dsm_guid, > + 1, DSM_PCI_PRESERVE_BOOT_CONFIG, > + NULL, ACPI_TYPE_INTEGER); > + if (obj && obj->integer.value == 0) > + return true; > + ACPI_FREE(obj); > + } > + > + return false; > +} -- With Best Regards, Andy Shevchenko