Merge branch 'linus' into cpus4096
[pandora-kernel.git] / arch / x86 / kernel / pci-dma.c
index 09c4dac..8467ec2 100644 (file)
@@ -7,6 +7,7 @@
 #include <asm/dma.h>
 #include <asm/gart.h>
 #include <asm/calgary.h>
+#include <asm/amd_iommu.h>
 
 int forbid_dac __read_mostly;
 EXPORT_SYMBOL(forbid_dac);
@@ -74,7 +75,7 @@ early_param("dma32_size", parse_dma32_size_opt);
 void __init dma32_reserve_bootmem(void)
 {
        unsigned long size, align;
-       if (end_pfn <= MAX_DMA32_PFN)
+       if (max_pfn <= MAX_DMA32_PFN)
                return;
 
        /*
@@ -93,7 +94,7 @@ void __init dma32_reserve_bootmem(void)
 static void __init dma32_free_bootmem(void)
 {
 
-       if (end_pfn <= MAX_DMA32_PFN)
+       if (max_pfn <= MAX_DMA32_PFN)
                return;
 
        if (!dma32_bootmem_ptr)
@@ -123,6 +124,8 @@ void __init pci_iommu_alloc(void)
 
        detect_intel_iommu();
 
+       amd_iommu_detect();
+
 #ifdef CONFIG_SWIOTLB
        pci_swiotlb_init();
 #endif
@@ -358,7 +361,7 @@ int dma_supported(struct device *dev, u64 mask)
 EXPORT_SYMBOL(dma_supported);
 
 /* Allocate DMA memory on node near device */
-noinline struct page *
+static noinline struct page *
 dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
 {
        int node;
@@ -503,6 +506,8 @@ static int __init pci_iommu_init(void)
 
        intel_iommu_init();
 
+       amd_iommu_init();
+
 #ifdef CONFIG_GART_IOMMU
        gart_iommu_init();
 #endif