summaryrefslogtreecommitdiff
path: root/drivers/pci/host/pcie-iproc.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-03-09 20:27:07 +0300
committerBjorn Helgaas <bhelgaas@google.com>2017-03-09 20:27:07 +0300
commit6e347b5e05ea2ac4ac467a5a1cfaebb2c7f06f80 (patch)
tree0333d0ac14c1e94b48eb2e8baeed11a8da9d6544 /drivers/pci/host/pcie-iproc.h
parent3bd7db63a841e8c5297bb18ad801df67d5e38ad2 (diff)
downloadlinux-6e347b5e05ea2ac4ac467a5a1cfaebb2c7f06f80.tar.xz
PCI: iproc: Save host bridge window resource in struct iproc_pcie
The host bridge memory window resource is inserted into the iomem_resource tree and cannot be deallocated until the host bridge itself is removed. Previously, the window was on the stack, which meant the iomem_resource entry pointed into the stack and was corrupted as soon as the probe function returned, which caused memory corruption and errors like this: pcie_iproc_bcma bcma0:8: resource collision: [mem 0x40000000-0x47ffffff] conflicts with PCIe MEM space [mem 0x40000000-0x47ffffff] Move the memory window resource from the stack into struct iproc_pcie so its lifetime matches that of the host bridge. Fixes: c3245a566400 ("PCI: iproc: Request host bridge window resources") Reported-and-tested-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: stable@vger.kernel.org # v4.8+
Diffstat (limited to 'drivers/pci/host/pcie-iproc.h')
-rw-r--r--drivers/pci/host/pcie-iproc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h
index 04fed8e907f1..0bbe2ea44f3e 100644
--- a/drivers/pci/host/pcie-iproc.h
+++ b/drivers/pci/host/pcie-iproc.h
@@ -90,6 +90,7 @@ struct iproc_pcie {
#ifdef CONFIG_ARM
struct pci_sys_data sysdata;
#endif
+ struct resource mem;
struct pci_bus *root_bus;
struct phy *phy;
int (*map_irq)(const struct pci_dev *, u8, u8);