[PATCH] PCI: handle subtractive decode pci-pci bridge better

With the number of PCI bus resources increased to 8, we can
handle the subtractive decode PCI-PCI bridge like a normal
bridge, taking into account standard PCI-PCI bridge windows
(resources 0-2). This helps to avoid problems with peer-to-peer DMA
behind such bridges, poor performance for MMIO ranges outside bridge
windows and prefetchable vs. non-prefetchable memory issues.

To reflect the fact that such bridges do forward all addresses to
the secondary bus (transparency), remaining bus resources 3-7 are
linked to resources 0-4 of the primary bus. These resources will be
used as fallback by resource management code if allocation from
standard bridge windows fails for some reason.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Ivan Kokshaysky and committed by
Greg Kroah-Hartman
90b54929 a03fa955

+2 -3
+2 -3
drivers/pci/probe.c
··· 239 239 240 240 if (dev->transparent) { 241 241 printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); 242 - for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) 243 - child->resource[i] = child->parent->resource[i]; 244 - return; 242 + for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) 243 + child->resource[i] = child->parent->resource[i - 3]; 245 244 } 246 245 247 246 for(i=0; i<3; i++)