lkml.org 
[lkml]   [2024]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@google.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



\
 
 \ /
  Last update: 2024-05-27 17:55    [W:0.111 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site