Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / x86_64 / kernel / pci-swiotlb.c
index 3569a25..697f0aa 100644 (file)
@@ -3,7 +3,8 @@
 #include <linux/pci.h>
 #include <linux/cache.h>
 #include <linux/module.h>
-#include <asm/dma-mapping.h>
+#include <linux/dma-mapping.h>
+
 #include <asm/proto.h>
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
@@ -31,12 +32,13 @@ struct dma_mapping_ops swiotlb_dma_ops = {
 void pci_swiotlb_init(void)
 {
        /* don't initialize swiotlb if iommu=off (no_iommu=1) */
-       if (!iommu_aperture && !no_iommu &&
-           (end_pfn > MAX_DMA32_PFN || force_iommu))
+       if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN)
               swiotlb = 1;
+       if (swiotlb_force)
+               swiotlb = 1;
        if (swiotlb) {
-               swiotlb_init();
                printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
+               swiotlb_init();
                dma_ops = &swiotlb_dma_ops;
        }
 }