]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/pci-dma_64.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[linux-2.6] / arch / x86 / kernel / pci-dma_64.c
index 29711445c8187464c6c00b14938451c23732df3e..393e2725a6e31a386a9b28817317990ef5d79871 100644 (file)
@@ -7,11 +7,12 @@
 #include <linux/string.h>
 #include <linux/pci.h>
 #include <linux/module.h>
+#include <linux/dmar.h>
 #include <asm/io.h>
 #include <asm/iommu.h>
 #include <asm/calgary.h>
 
-int iommu_merge __read_mostly = 0;
+int iommu_merge __read_mostly = 1;
 EXPORT_SYMBOL(iommu_merge);
 
 dma_addr_t bad_dma_address __read_mostly;
@@ -51,11 +52,9 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
 {
        struct page *page;
        int node;
-#ifdef CONFIG_PCI
-       if (dev->bus == &pci_bus_type)
-               node = pcibus_to_node(to_pci_dev(dev)->bus);
-       else
-#endif
+
+       node = dev_to_node(dev);
+       if (node == -1)
                node = numa_node_id();
 
        if (node < first_node(node_online_map))
@@ -167,6 +166,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
 void dma_free_coherent(struct device *dev, size_t size,
                         void *vaddr, dma_addr_t bus)
 {
+       WARN_ON(irqs_disabled());       /* for portability */
        if (dma_ops->unmap_single)
                dma_ops->unmap_single(dev, bus, size, 0);
        free_pages((unsigned long)vaddr, get_order(size));
@@ -306,6 +306,8 @@ void __init pci_iommu_alloc(void)
        detect_calgary();
 #endif
 
+       detect_intel_iommu();
+
 #ifdef CONFIG_SWIOTLB
        pci_swiotlb_init();
 #endif
@@ -317,6 +319,8 @@ static int __init pci_iommu_init(void)
        calgary_iommu_init();
 #endif
 
+       intel_iommu_init();
+
 #ifdef CONFIG_IOMMU
        gart_iommu_init();
 #endif