Subject: [PATCH] PCI: Don't let ROM bar reduce chance to pref mem64

Now rom resource is set to PREFETCH, but is not MEM_64, So it would
make the whole bridge not use pref above 4g.

In that case, just clear PREFETCH for that rom resource, and push it
to bridge resource without pref.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 drivers/pci/setup-bus.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: linux-2.6/drivers/pci/setup-bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/setup-bus.c
+++ linux-2.6/drivers/pci/setup-bus.c
@@ -810,6 +810,16 @@ static int pbus_size_mem(struct pci_bus
 
 			if (r->parent || (r->flags & mask) != type)
 				continue;
+
+			/* Don't let ROM pull down pref64 */
+			if (sizeof(resource_size_t) >= 8 &&
+			    i == PCI_ROM_RESOURCE &&
+			    (type & IORESOURCE_PREFETCH) &&
+			    (mem64_mask & IORESOURCE_MEM_64)) {
+				r->flags &= ~IORESOURCE_PREFETCH;
+				continue;
+			}
+
 			r_size = resource_size(r);
 #ifdef CONFIG_PCI_IOV
 			/* put SRIOV requested res to the optional list */
