- 2.6.17 port work build breaks, but the patch set is relativly stable
[linux-flexiantxendom0-3.2.10.git] / arch / x86_64 / kernel / pci-gart.c
index 95a35b7..82a7c9b 100644 (file)
@@ -65,9 +65,7 @@ static u32 gart_unmapped_entry;
 
 #define for_all_nb(dev) \
        dev = NULL;     \
-       while ((dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, dev))!=NULL)\
-            if (dev->bus->number == 0 &&                                    \
-                   (PCI_SLOT(dev->devfn) >= 24) && (PCI_SLOT(dev->devfn) <= 31))
+       while ((dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, dev))!=NULL)
 
 static struct pci_dev *northbridges[MAX_NB];
 static u32 northbridge_flush_word[MAX_NB];
@@ -633,14 +631,20 @@ static int __init pci_iommu_init(void)
                printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
                if (end_pfn > MAX_DMA32_PFN) {
                        printk(KERN_ERR "WARNING more than 4GB of memory "
-                                       "but IOMMU not compiled in.\n"
-                              KERN_ERR "WARNING 32bit PCI may malfunction.\n"
-                              KERN_ERR "You might want to enable "
-                                       "CONFIG_GART_IOMMU\n");
+                                       "but IOMMU not available.\n"
+                              KERN_ERR "WARNING 32bit PCI may malfunction.\n");
                }
                return -1;
        }
 
+       i = 0;
+       for_all_nb(dev)
+               i++;
+       if (i > MAX_NB) {
+               printk(KERN_ERR "PCI-GART: Too many northbridges (%ld). Disabled\n", i);
+               return -1;
+       }
+
        printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n");
        aper_size = info.aper_size * 1024 * 1024;       
        iommu_size = check_iommu_size(info.aper_base, aper_size);