linux-stable/drivers/pci
Yinghai Lu 3a9ad0b4fd PCI: Add pci_bus_addr_t
David Ahern reported that d63e2e1f3d ("sparc/PCI: Clip bridge windows
to fit in upstream windows") fails to boot on sparc/T5-8:

  pci 0000:06:00.0: reg 0x184: can't handle BAR above 4GB (bus address 0x110204000)

The problem is that sparc64 assumed that dma_addr_t only needed to hold DMA
addresses, i.e., bus addresses returned via the DMA API (dma_map_single(),
etc.), while the PCI core assumed dma_addr_t could hold *any* bus address,
including raw BAR values.  On sparc64, all DMA addresses fit in 32 bits, so
dma_addr_t is a 32-bit type.  However, BAR values can be 64 bits wide, so
they don't fit in a dma_addr_t.  d63e2e1f3d added new checking that
tripped over this mismatch.

Add pci_bus_addr_t, which is wide enough to hold any PCI bus address,
including both raw BAR values and DMA addresses.  This will be 64 bits
on 64-bit platforms and on platforms with a 64-bit dma_addr_t.  Then
dma_addr_t only needs to be wide enough to hold addresses from the DMA API.

[bhelgaas: changelog, bugzilla, Kconfig to ensure pci_bus_addr_t is at
least as wide as dma_addr_t, documentation]
Fixes: d63e2e1f3d ("sparc/PCI: Clip bridge windows to fit in upstream windows")
Fixes: 23b13bc76f ("PCI: Fail safely if we can't handle BARs larger than 4GB")
Link: http://lkml.kernel.org/r/CAE9FiQU1gJY1LYrxs+ma5LCTEEe4xmtjRG0aXJ9K_Tsu+m9Wuw@mail.gmail.com
Link: http://lkml.kernel.org/r/1427857069-6789-1-git-send-email-yinghai@kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=96231
Reported-by: David Ahern <david.ahern@oracle.com>
Tested-by: David Ahern <david.ahern@oracle.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
CC: stable@vger.kernel.org	# v3.19+
2015-05-29 17:21:45 -05:00
..
host PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
hotplug powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
pcie PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
Kconfig PCI: Add pci_bus_addr_t 2015-05-29 17:21:45 -05:00
Makefile PCI: Remove PCI ioapic driver 2014-12-16 14:08:14 +01:00
access.c PCI: Add generic config accessors 2015-01-22 13:59:45 -06:00
ats.c PCI: Removed unused parts of Page Request Interface support 2014-01-10 14:00:47 -07:00
bus.c PCI: Add pci_bus_addr_t 2015-05-29 17:21:45 -05:00
host-bridge.c Merge branch 'pci/misc' into next 2015-04-10 08:27:18 -05:00
hotplug-pci.c PCI: Remove unnecessary __ref annotations 2014-04-29 17:36:44 -06:00
htirq.c PCI changes for the v3.16 merge window (part 2): 2014-06-12 13:20:24 -07:00
iov.c PCI: Add pcibios_iov_resource_alignment() interface 2015-03-31 13:02:36 +11:00
irq.c
msi.c PCI: Fail MSI-X mappings if there's no space assigned to MSI-X BAR 2015-01-28 09:25:57 -06:00
of.c
pci-acpi.c PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
pci-driver.c ACPI and power management updates for v3.20-rc1 2015-02-10 15:09:41 -08:00
pci-label.c PCI: Make a shareable UUID for PCI firmware ACPI _DSM 2015-04-08 14:39:30 -05:00
pci-stub.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
pci-sysfs.c PCI: Don't read past the end of sysfs "driver_override" buffer 2015-02-24 17:35:37 -06:00
pci.c Merge branch 'pci/misc' into next 2015-04-10 08:27:18 -05:00
pci.h powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
probe.c PCI: Add pci_bus_addr_t 2015-05-29 17:21:45 -05:00
proc.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
quirks.c Merge branch 'pci/misc' into next 2015-04-10 08:27:18 -05:00
remove.c PCI: Export symbols required for loadable host driver modules 2015-04-08 14:17:10 -05:00
rom.c PCI: Fix infinite loop with ROM image of size 0 2015-01-23 17:42:59 -06:00
search.c PCI: Delete unnecessary NULL pointer checks 2014-11-10 21:02:17 -07:00
setup-bus.c powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
setup-irq.c PCI: Export symbols required for loadable host driver modules 2015-04-08 14:17:10 -05:00
setup-res.c PCI: Mark invalid BARs as unassigned 2015-03-12 18:52:12 -05:00
slot.c VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms. 2014-03-24 12:21:00 +10:30
syscall.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
vc.c
vpd.c
xen-pcifront.c xenbus_client: Extend interface to support multi-page ring 2015-04-15 10:56:47 +01:00