[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZiYVqulm8cE_FGKx@surfacebook.localdomain>
Date: Mon, 22 Apr 2024 10:45:46 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Vidya Sagar <vidyas@...dia.com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Will Deacon <will@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Thierry Reding <treding@...dia.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Krishna Thota <kthota@...dia.com>,
Manikanta Maddireddy <mmaddireddy@...dia.com>,
Vidya Sagar <sagar.tv@...il.com>, linux-pci@...r.kernel.org,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH v7-incomplete 1/3] PCI: Move PRESERVE_BOOT_CONFIG _DSM
evaluation to pci_register_host_bridge()
Sun, Apr 21, 2024 at 02:09:12PM -0500, Bjorn Helgaas kirjoitti:
> From: Bjorn Helgaas <bhelgaas@...gle.com>
>
> 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
Powered by blists - more mailing lists