]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/amd-iommu: Fall back to GART if initialization fails
authorJoerg Roedel <joerg.roedel@amd.com>
Mon, 31 May 2010 13:05:20 +0000 (15:05 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:22:24 +0000 (11:22 -0700)
commit d7f0776975334070a93370ae048fda0c31a91c38 upstream.

This patch implements a fallback to the GART IOMMU if this
is possible and the AMD IOMMU initialization failed.
Otherwise the fallback would be nommu which is very
problematic on machines with more than 4GB of memory or
swiotlb which hurts io-performance.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/amd_iommu_init.c

index f854d89b7edf6cdc933043732497020e4cdb48a2..b9ce0fdf2cb54e51fa876f456bf7b7270443e7f5 100644 (file)
@@ -2257,10 +2257,6 @@ int __init amd_iommu_init_dma_ops(void)
 
        iommu_detected = 1;
        swiotlb = 0;
-#ifdef CONFIG_GART_IOMMU
-       gart_iommu_aperture_disabled = 1;
-       gart_iommu_aperture = 0;
-#endif
 
        /* Make the driver finally visible to the drivers */
        dma_ops = &amd_iommu_dma_ops;
index 890af003488cb58133daaddfde9a21940f3b2df5..6f8ce7516b7a3662e4813d803a2788bbd19d19c7 100644 (file)
@@ -1357,6 +1357,15 @@ free:
 
        free_unity_maps();
 
+#ifdef CONFIG_GART_IOMMU
+       /*
+        * We failed to initialize the AMD IOMMU - try fallback to GART
+        * if possible.
+        */
+       gart_iommu_init();
+
+#endif
+
        goto out;
 }