Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[pandora-kernel.git] / arch / x86 / kernel / pci-dma_64.c
index 9576a2e..5552d23 100644 (file)
@@ -7,8 +7,9 @@
 #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/gart.h>
 #include <asm/calgary.h>
 
 int iommu_merge __read_mostly = 0;
@@ -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))
@@ -276,7 +275,7 @@ __init int iommu_setup(char *p)
                        swiotlb = 1;
 #endif
 
-#ifdef CONFIG_IOMMU
+#ifdef CONFIG_GART_IOMMU
                gart_parse_options(p);
 #endif
 
@@ -299,14 +298,16 @@ void __init pci_iommu_alloc(void)
         * The order of these functions is important for
         * fall-back/fail-over reasons
         */
-#ifdef CONFIG_IOMMU
-       iommu_hole_init();
+#ifdef CONFIG_GART_IOMMU
+       gart_iommu_hole_init();
 #endif
 
 #ifdef CONFIG_CALGARY_IOMMU
        detect_calgary();
 #endif
 
+       detect_intel_iommu();
+
 #ifdef CONFIG_SWIOTLB
        pci_swiotlb_init();
 #endif
@@ -318,7 +319,9 @@ static int __init pci_iommu_init(void)
        calgary_iommu_init();
 #endif
 
-#ifdef CONFIG_IOMMU
+       intel_iommu_init();
+
+#ifdef CONFIG_GART_IOMMU
        gart_iommu_init();
 #endif