]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86_64/kernel/pci-gart.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-bugfix
[linux-2.6-omap-h63xx.git] / arch / x86_64 / kernel / pci-gart.c
index c37fc7726ba6704a5ff02a2ca6f32463f2420d8d..2fe23a6c361bbfa77524472027e47680b2bf05b4 100644 (file)
@@ -457,9 +457,12 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
 error:
        flush_gart(NULL);
        gart_unmap_sg(dev, sg, nents, dir);
-       /* When it was forced try again unforced */
-       if (force_iommu) 
-               return dma_map_sg_nonforce(dev, sg, nents, dir);
+       /* When it was forced or merged try again in a dumb way */
+       if (force_iommu || iommu_merge) {
+               out = dma_map_sg_nonforce(dev, sg, nents, dir);
+               if (out > 0)
+                       return out;
+       }
        if (panic_on_overflow)
                panic("dma_map_sg: overflow on %lu pages\n", pages);
        iommu_full(dev, pages << PAGE_SHIFT, dir);
@@ -642,9 +645,18 @@ static int __init pci_iommu_init(void)
            (no_agp && init_k8_gatt(&info) < 0)) {
                no_iommu = 1;
                no_iommu_init();
+               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");
+               }
                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); 
        iommu_pages = iommu_size >> PAGE_SHIFT; 
@@ -718,7 +730,6 @@ static int __init pci_iommu_init(void)
                     
        flush_gart(NULL);
 
-       printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n");
        dma_ops = &gart_dma_ops;
 
        return 0;