Skip to content

Commit

Permalink
arm64: PCI: Preserve firmware configuration when desired
Browse files Browse the repository at this point in the history
If we must preserve the firmware resource assignments, claim the existing
resources rather than reassigning everything.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Acked-by: Lorenzo Pieralisi <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
  • Loading branch information
ozbenh authored and bjorn-helgaas committed Jun 21, 2019
1 parent 3e8ba96 commit 85dc041
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/arm64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
struct acpi_pci_generic_root_info *ri;
struct pci_bus *bus, *child;
struct acpi_pci_root_ops *root_ops;
struct pci_host_bridge *host;

ri = kzalloc(sizeof(*ri), GFP_KERNEL);
if (!ri)
Expand All @@ -193,6 +194,15 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
if (!bus)
return NULL;

/* If we must preserve the resource configuration, claim now */
host = pci_find_host_bridge(bus);
if (host->preserve_config)
pci_bus_claim_resources(bus);

/*
* Assign whatever was left unassigned. If we didn't claim above,
* this will reassign everything.
*/
pci_assign_unassigned_root_bus_resources(bus);

list_for_each_entry(child, &bus->children, node)
Expand Down

0 comments on commit 85dc041

Please sign in to comment.