Skip to content

Commit

Permalink
x86/amd-iommu: Fall back to GART if initialization fails
Browse files Browse the repository at this point in the history
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.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Joerg Roedel committed Jun 1, 2010
1 parent e82752d commit d7f0776
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 0 additions & 4 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,10 +2330,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;
Expand Down
9 changes: 9 additions & 0 deletions arch/x86/kernel/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,15 @@ static int __init amd_iommu_init(void)

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;
}

Expand Down

0 comments on commit d7f0776

Please sign in to comment.