alistair23-linux/drivers/pci/host
Lorenzo Pieralisi 13f392ebc3 PCI: tegra: Fix pci_remap_iospace() failure path
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped
IO, by reserving a chunk of virtual address space starting at PCI_IOBASE
and by mapping the PCI host bridges memory address space driving PCI IO
cycles to it.

PCI host bridge drivers that enable downstream PCI IO cycles map the host
bridge memory address responding to PCI IO cycles to the fixed virtual
address space through the pci_remap_iospace() API.

This means that if the pci_remap_iospace() function fails, the
corresponding host bridge PCI IO resource must be considered invalid, in
that there is no way for the kernel to actually drive PCI IO transactions
if the memory addresses responding to PCI IO cycles cannot be mapped into
the CPU virtual address space.

The PCI tegra host bridge driver adds the PCI IO resource retrieved from
firmware to the host bridge resource windows even if the
pci_remap_iospace() call fails; this is an actual bug in that the PCI host
bridge would consider the PCI IO resource valid (and possibly assign it to
downstream devices) even if the kernel was not able to map the PCI host
bridge memory address driving IO cycle to the CPU virtual address space (ie
pci_remap_iospace() failures).

Add the PCI host bridge driver pci_remap_iospace() failure path and do not
add the corresponding PCI host bridge PCI IO resources retrieved through
firmware when the pci_remap_iospace() function call fails, fixing the
issue.

Fixes: e6e9f471f5 ("PCI: tegra: Use generic pci_remap_iospace() rather than ARM32-specific one")
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Thierry Reding <treding@nvidia.com>
2016-09-06 12:42:53 -05:00
..
Kconfig Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-dra7xx', 'pci/host-hv', 'pci/host-vmd' and 'pci/host-xilinx' into next 2016-08-01 12:32:13 -05:00
Makefile Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-dra7xx', 'pci/host-hv', 'pci/host-vmd' and 'pci/host-xilinx' into next 2016-08-01 12:32:13 -05:00
pci-aardvark.c PCI: aardvark: Fix pci_remap_iospace() failure path 2016-09-06 12:37:55 -05:00
pci-dra7xx.c PCI: dra7xx: Fix return value in case of error 2016-07-25 12:29:51 -05:00
pci-exynos.c
pci-host-common.c PCI: generic: Fix pci_remap_iospace() failure path 2016-09-06 12:42:13 -05:00
pci-host-generic.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
pci-hyperv.c PCI: hv: Fix interrupt cleanup path 2016-07-25 12:33:36 -05:00
pci-imx6.c PCI: imx6: Implement reset sequence for i.MX6+ 2016-05-02 14:33:17 -05:00
pci-keystone-dw.c PCI: keystone: Add error IRQ handler 2016-04-14 14:40:42 -05:00
pci-keystone.c PCI: keystone: Make explicitly non-modular 2016-08-01 12:22:50 -05:00
pci-keystone.h PCI: keystone: Add error IRQ handler 2016-04-14 14:40:42 -05:00
pci-layerscape.c PCI: layerscape: Make explicitly non-modular 2016-08-01 12:22:50 -05:00
pci-mvebu.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
pci-rcar-gen2.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
pci-tegra.c PCI: tegra: Fix pci_remap_iospace() failure path 2016-09-06 12:42:53 -05:00
pci-thunder-ecam.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
pci-thunder-pem.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
pci-versatile.c PCI: versatile: Fix pci_remap_iospace() failure path 2016-09-06 12:41:15 -05:00
pci-xgene-msi.c
pci-xgene.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
pcie-altera-msi.c
pcie-altera.c Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-dra7xx', 'pci/host-hv', 'pci/host-vmd' and 'pci/host-xilinx' into next 2016-08-01 12:32:13 -05:00
pcie-armada8k.c PCI: armada8k: Make explicitly non-modular 2016-08-01 12:22:50 -05:00
pcie-artpec6.c PCI: artpec6: Make explicitly non-modular 2016-08-01 12:22:50 -05:00
pcie-designware-plat.c PCI: designware-plat: Make it explicitly non-modular 2016-08-01 12:22:50 -05:00
pcie-designware.c PCI: designware: Fix pci_remap_iospace() failure path 2016-09-06 12:39:38 -05:00
pcie-designware.h
pcie-hisi.c PCI: hisi: Make explicitly non-modular 2016-08-01 12:22:50 -05:00
pcie-iproc-bcma.c
pcie-iproc-msi.c
pcie-iproc-platform.c
pcie-iproc.c PCI: iproc: Request host bridge window resources 2016-06-20 14:06:05 -05:00
pcie-iproc.h
pcie-qcom.c
pcie-rcar.c PCI: rcar: Fix pci_remap_iospace() failure path 2016-09-06 12:41:50 -05:00
pcie-spear13xx.c
pcie-xilinx-nwl.c PCI: xilinx-nwl: Use dev_printk() when possible 2016-06-20 14:06:06 -05:00
pcie-xilinx.c Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-dra7xx', 'pci/host-hv', 'pci/host-vmd' and 'pci/host-xilinx' into next 2016-08-01 12:32:13 -05:00