aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2015-01-15 17:21:50 -0500
committerBjorn Helgaas <bhelgaas@google.com>2015-01-16 11:04:43 -0500
commit576e4385ff59f52ca0e9a6a953a55f1f76fc196b (patch)
tree603ff3d0da260aa3813399a3d154884f00defed9 /arch/microblaze
parentce821ef0333fc130154ed3091144a590c1909f4d (diff)
microblaze/PCI: Clip bridge windows to fit in upstream windows
Every PCI-PCI bridge window should fit inside an upstream bridge window because orphaned address space is unreachable from the primary side of the upstream bridge. If we inherit invalid bridge windows that overlap an upstream window from firmware, clip them to fit and update the bridge accordingly. [bhelgaas: changelog] Link: https://bugzilla.kernel.org/show_bug.cgi?id=85491 Reported-by: Marek Kordik <kordikmarek@gmail.com> Fixes: 5b28541552ef ("PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources") Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: Michal Simek <monstr@monstr.eu> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Sebastian Ott <sebott@linux.vnet.ibm.com>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/pci/pci-common.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index b30e41c0c033..48528fb81eff 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -1026,6 +1026,8 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus)
1026 pr, (pr && pr->name) ? pr->name : "nil"); 1026 pr, (pr && pr->name) ? pr->name : "nil");
1027 1027
1028 if (pr && !(pr->flags & IORESOURCE_UNSET)) { 1028 if (pr && !(pr->flags & IORESOURCE_UNSET)) {
1029 struct pci_dev *dev = bus->self;
1030
1029 if (request_resource(pr, res) == 0) 1031 if (request_resource(pr, res) == 0)
1030 continue; 1032 continue;
1031 /* 1033 /*
@@ -1035,6 +1037,12 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus)
1035 */ 1037 */
1036 if (reparent_resources(pr, res) == 0) 1038 if (reparent_resources(pr, res) == 0)
1037 continue; 1039 continue;
1040
1041 if (dev && i < PCI_BRIDGE_RESOURCE_NUM &&
1042 pci_claim_bridge_resource(dev,
1043 i + PCI_BRIDGE_RESOURCES) == 0)
1044 continue;
1045
1038 } 1046 }
1039 pr_warn("PCI: Cannot allocate resource region "); 1047 pr_warn("PCI: Cannot allocate resource region ");
1040 pr_cont("%d of PCI bridge %d, will remap\n", i, bus->number); 1048 pr_cont("%d of PCI bridge %d, will remap\n", i, bus->number);
@@ -1227,7 +1235,10 @@ void pcibios_claim_one_bus(struct pci_bus *bus)
1227 (unsigned long long)r->end, 1235 (unsigned long long)r->end,
1228 (unsigned int)r->flags); 1236 (unsigned int)r->flags);
1229 1237
1230 pci_claim_resource(dev, i); 1238 if (pci_claim_resource(dev, i) == 0)
1239 continue;
1240
1241 pci_claim_bridge_resource(dev, i);
1231 } 1242 }
1232 } 1243 }
1233 1244