linux-stable/drivers/pci
Bjorn Helgaas ac93ac7403 PCI: Don't check resource_size() in pci_bus_alloc_resource()
Paul reported that after f75b99d5a7 ("PCI: Enforce bus address limits in
resource allocation") on a 32-bit kernel (CONFIG_PHYS_ADDR_T_64BIT not
set), intel-gtt complained "can't ioremap flush page - no chipset
flushing".  In addition, other PCI resource allocations, e.g., for bridge
windows, failed.

This happens because we incorrectly skip bus resources of
[mem 0x00000000-0xffffffff] because we think they are of size zero.
When resource_size_t is 32 bits wide, resource_size() on
[mem 0x00000000-0xffffffff] returns 0 because (r->end - r->start + 1)
overflows.

Therefore, we can't use "resource_size() == 0" to decide that allocation
from this resource will fail.  allocate_resource() should fail anyway if it
can't satisfy the address constraints, so we should just depend on that.

A [mem 0x00000000-0xffffffff] bus resource is obviously not really valid,
but we do fall back to it as a default when we don't have information about
host bridge apertures.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=71611
Fixes: f75b99d5a7 PCI: Enforce bus address limits in resource allocation
Reported-and-tested-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-03-12 11:19:20 -06:00
..
host PCI: mvebu: Use Device ID and revision from underlying endpoint 2014-02-12 14:05:54 -07:00
hotplug ACPI / hotplug / PCI: Relax the checking of _STA return values 2014-02-12 12:45:57 +01:00
pcie Merge branch 'pci/dead-code' into next 2014-01-13 16:47:08 -07:00
Kconfig PCI: Convert ioapic to be builtin only, not modular 2014-01-03 14:31:38 -07:00
Makefile PCI: Add Virtual Channel to save/restore support 2013-12-17 17:39:08 -07:00
access.c PCI: Remove unused pci_vpd_truncate() 2014-01-13 11:14:43 -07:00
ats.c PCI: Removed unused parts of Page Request Interface support 2014-01-10 14:00:47 -07:00
bus.c PCI: Don't check resource_size() in pci_bus_alloc_resource() 2014-03-12 11:19:20 -06:00
host-bridge.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
hotplug-pci.c PCI: hotplug: remove pci_do_scan_bus() 2012-06-13 15:42:27 -06:00
htirq.c
ioapic.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
iov.c PCI: Never treat a VF as a multifunction device 2014-01-10 10:05:26 -07:00
irq.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
msi.c PCI/MSI: Fix pci_msix_vec_count() htmldocs failure 2014-02-13 10:47:44 -07:00
of.c
pci-acpi.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pci-driver.c PCI: Disable Bus Master only on kexec reboot 2013-12-07 14:20:28 -07:00
pci-label.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pci-stub.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
pci-sysfs.c PCI: Add global pci_lock_rescan_remove() 2014-01-13 17:49:49 -07:00
pci.c PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled 2014-03-12 11:19:18 -06:00
pci.h PCI: Make local functions static 2014-01-13 11:57:29 -07:00
probe.c Revert "PCI: Remove from bus_list and release resources in pci_release_dev()" 2014-02-01 10:24:31 -08:00
proc.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
quirks.c PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
remove.c Revert "PCI: Remove from bus_list and release resources in pci_release_dev()" 2014-02-01 10:24:31 -08:00
rom.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
search.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
setup-bus.c Merge branch 'pci/resource' into next 2014-01-10 14:23:15 -07:00
setup-irq.c PCI: Provide a default pcibios_update_irq() 2012-09-18 17:28:21 -06:00
setup-res.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
slot.c PCI: Remove unused pci_renumber_slot() 2014-01-13 11:14:44 -07:00
syscall.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
vc.c PCI: Rename PCI_VC_PORT_REG1/2 to PCI_VC_PORT_CAP1/2 2013-12-17 17:49:39 -07:00
vpd.c
xen-pcifront.c Features: 2014-01-22 22:00:18 -08:00