alistair23-linux/drivers/pci
Ard Biesheuvel 3134233097 PCI: Do not disregard parent resources starting at 0x0
Commit f44116ae88 ("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 f44116ae88.

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>
2017-05-17 16:20:35 -05:00
..
dwc pci-v4.12-changes 2017-05-08 19:03:25 -07:00
endpoint PCI: endpoint: functions: Add an EP function to test PCI 2017-04-11 14:18:37 -05:00
host PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
hotplug Annotation of module parameters that specify device settings 2017-05-10 19:13:03 -07:00
pcie Merge branch 'pci/enumeration' into next 2017-04-28 10:33:55 -05:00
switch switchtec: Add IOCTLs to the Switchtec driver 2017-04-12 12:23:37 -05:00
access.c Merge branch 'pci/misc' into next 2017-04-28 10:34:14 -05:00
ats.c
bus.c
ecam.c PCI: ECAM: Map config region with pci_remap_cfgspace() 2017-04-24 13:53:14 -05:00
host-bridge.c
hotplug-pci.c
htirq.c
iov.c PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding 2017-04-20 08:53:51 -05:00
irq.c pci-v4.12-changes 2017-05-08 19:03:25 -07:00
Kconfig Merge branch 'pci/switchtec' into next 2017-04-28 10:33:41 -05:00
Makefile Merge branch 'pci/resource-mmap' into next 2017-04-28 10:34:34 -05:00
mmap.c PCI: Add I/O BAR support to generic pci_mmap_resource_range() 2017-04-20 08:47:47 -05:00
msi.c pci-v4.12-changes 2017-05-08 19:03:25 -07:00
of.c
pci-acpi.c
pci-driver.c Merge branch 'pci/virtualization' into next 2017-04-28 10:36:12 -05:00
pci-label.c
pci-mid.c
pci-stub.c
pci-sysfs.c Merge branch 'pci/virtualization' into next 2017-04-28 10:36:12 -05:00
pci.c PCI: Do not disregard parent resources starting at 0x0 2017-05-17 16:20:35 -05:00
pci.h pci-v4.12-changes 2017-05-08 19:03:25 -07:00
probe.c IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
proc.c PCI: Add BAR index argument to pci_mmap_page_range() 2017-04-20 08:47:47 -05:00
quirks.c Merge branch 'pci/virtualization' into next 2017-04-28 10:36:12 -05:00
remove.c
rom.c
search.c PCI: Add device flag PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT 2017-04-13 18:49:50 -05:00
setup-bus.c PCI: Fix calculation of bridge window's size and alignment 2017-04-18 14:47:20 -05:00
setup-irq.c
setup-res.c PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant 2017-04-18 14:46:57 -05:00
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c