diff options
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index fcc2f2bfa39c..75e14e21f61a 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -120,15 +120,12 @@ static void __init dma32_free_bootmem(void) | |||
120 | 120 | ||
121 | void __init pci_iommu_alloc(void) | 121 | void __init pci_iommu_alloc(void) |
122 | { | 122 | { |
123 | int use_swiotlb; | ||
124 | |||
125 | use_swiotlb = pci_swiotlb_init(); | ||
126 | #ifdef CONFIG_X86_64 | 123 | #ifdef CONFIG_X86_64 |
127 | /* free the range so iommu could get some range less than 4G */ | 124 | /* free the range so iommu could get some range less than 4G */ |
128 | dma32_free_bootmem(); | 125 | dma32_free_bootmem(); |
129 | #endif | 126 | #endif |
130 | if (use_swiotlb) | 127 | if (pci_swiotlb_detect()) |
131 | return; | 128 | goto out; |
132 | 129 | ||
133 | gart_iommu_hole_init(); | 130 | gart_iommu_hole_init(); |
134 | 131 | ||
@@ -138,6 +135,8 @@ void __init pci_iommu_alloc(void) | |||
138 | 135 | ||
139 | /* needs to be called after gart_iommu_hole_init */ | 136 | /* needs to be called after gart_iommu_hole_init */ |
140 | amd_iommu_detect(); | 137 | amd_iommu_detect(); |
138 | out: | ||
139 | pci_swiotlb_init(); | ||
141 | } | 140 | } |
142 | 141 | ||
143 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 142 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, |