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 7389AC4345F for ; Mon, 22 Apr 2024 07:46:06 +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:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RxlV5s5yZwo9XFD6ILA/tTukVm7khbRGo5QxtQAIc8w=; b=QYLSXCp5RqQ/Wr gEKc0qu5rg0EgQFQgS5MTdner/s8N5yHgE94C9vce/JfcRfaq//dL2heNekUwFNpZ177nHkxnPc0S hi/g07M5CtACNoNfnhiQy5ZOqsm6bWeSwjnN4uNu+jlhdxKdpHVZZh8+JpEgJvi/OG9aBovaZ/I8K +6OtKzpnjMGMLYor1nYEbIRcHn12osDIg4frXsZEnomdGSy7k7kq62cDnLcPnY0d+F7t/3Hpzmy2q TvD7ReNZvo7f+uzKdTKPj7LKrLSauJ8WT+/RF0nnA8mYHy/ZGfUAUFOC/h2Yu0ooYWMYRSYF7c/4N DwfGncM4PmY3l4mI9msw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryoN6-0000000CUnF-3QPV; Mon, 22 Apr 2024 07:45:52 +0000 Received: from fgw21-7.mail.saunalahti.fi ([62.142.5.82]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryoN3-0000000CUlK-3hsz for linux-arm-kernel@lists.infradead.org; Mon, 22 Apr 2024 07:45:51 +0000 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240421190914.374399-2-helgaas@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240422_004550_101069_45A8BF3E X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel