diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-04-11 18:33:12 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-05-17 23:20:35 +0200 |
commit | 3134233097791ae64002a51c2c8c9bf2ab200ea0 (patch) | |
tree | d7061beaf26898c36df039a3d6044542ba6b6196 /drivers/pci/pci.c | |
parent | Linux 4.12-rc1 (diff) | |
download | linux-3134233097791ae64002a51c2c8c9bf2ab200ea0.tar.xz linux-3134233097791ae64002a51c2c8c9bf2ab200ea0.zip |
PCI: Do not disregard parent resources starting at 0x0
Commit f44116ae8818 ("PCI: Remove pci_find_parent_resource() use for
allocation") updated the logic that iterates over all bus resources and
compares them to a given resource, in order to decide whether one is the
parent of the latter.
This change inadvertently causes pci_find_parent_resource() to disregard
resources starting at address 0x0, resulting in an error such as the one
below on ARM systems whose I/O window starts at 0x0.
pci_bus 0000:00: root bus resource [mem 0x10000000-0x3efeffff window]
pci_bus 0000:00: root bus resource [io 0x0000-0xffff window]
pci_bus 0000:00: root bus resource [mem 0x8000000000-0xffffffffff window]
pci_bus 0000:00: root bus resource [bus 00-0f]
pci 0000:00:01.0: PCI bridge to [bus 01]
pci 0000:00:02.0: PCI bridge to [bus 02]
pci 0000:00:03.0: PCI bridge to [bus 03]
pci 0000:00:03.0: can't claim BAR 13 [io 0x0000-0x0fff]: no compatible bridge window
pci 0000:03:01.0: can't claim BAR 0 [io 0x0000-0x001f]: no compatible bridge window
While this never happens on x86, it is perfectly legal in general for a PCI
MMIO or IO window to start at address 0x0, and it was supported in the code
before commit f44116ae8818.
Drop the test for res->start != 0; resource_contains() already checks
whether [start, end) completely covers the resource, and so it should be
redundant.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b01bd5bba8e6..d5575f6b9c62 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -455,7 +455,7 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev, pci_bus_for_each_resource(bus, r, i) { if (!r) continue; - if (res->start && resource_contains(r, res)) { + if (resource_contains(r, res)) { /* * If the window is prefetchable but the BAR is |