Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: PCI: Exclude ACPI "consumer" resources from host bridge windows

On x86 and ia64, we have treated all ACPI _CRS resources of PNP0A03 host
bridge devices as "producers", i.e., as host bridge windows. That's partly
because some x86 BIOSes improperly used "consumer" descriptors to describe
windows and partly because Linux didn't have good support for handling
consumer and producer descriptors differently.

One result is that x86 BIOSes describe host bridge "consumer" resources in
the _CRS of a PNP0C02 device, not the PNP0A03 device itself. On arm64 we
don't have a legacy of firmware that has this consumer/producer confusion,
so we can handle PNP0A03 "consumer" descriptors as host bridge registers
instead of windows.

Exclude non-window ("consumer") resources from the list of host bridge
windows. This allows the use of "consumer" PNP0A03 descriptors for bridge
register space.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

Bjorn Helgaas and committed by
Bjorn Helgaas
8fd4391e 093d24a2

+14
+14
arch/arm64/kernel/pci.c
··· 114 114 return 0; 115 115 } 116 116 117 + static int pci_acpi_root_prepare_resources(struct acpi_pci_root_info *ci) 118 + { 119 + struct resource_entry *entry, *tmp; 120 + int status; 121 + 122 + status = acpi_pci_probe_root_resources(ci); 123 + resource_list_for_each_entry_safe(entry, tmp, &ci->resources) { 124 + if (!(entry->res->flags & IORESOURCE_WINDOW)) 125 + resource_list_destroy_entry(entry); 126 + } 127 + return status; 128 + } 129 + 117 130 /* 118 131 * Lookup the bus range for the domain in MCFG, and set up config space 119 132 * mapping. ··· 209 196 } 210 197 211 198 root_ops->release_info = pci_acpi_generic_release_info; 199 + root_ops->prepare_resources = pci_acpi_root_prepare_resources; 212 200 root_ops->pci_ops = &ri->cfg->ops->pci_ops; 213 201 bus = acpi_pci_root_create(root, root_ops, &ri->common, ri->cfg); 214 202 if (!bus)