|
@@ -120,15 +120,12 @@ static void __init dma32_free_bootmem(void)
|
|
|
|
|
|
void __init pci_iommu_alloc(void)
|
|
void __init pci_iommu_alloc(void)
|
|
{
|
|
{
|
|
- int use_swiotlb;
|
|
|
|
-
|
|
|
|
- use_swiotlb = pci_swiotlb_init();
|
|
|
|
#ifdef CONFIG_X86_64
|
|
#ifdef CONFIG_X86_64
|
|
/* free the range so iommu could get some range less than 4G */
|
|
/* free the range so iommu could get some range less than 4G */
|
|
dma32_free_bootmem();
|
|
dma32_free_bootmem();
|
|
#endif
|
|
#endif
|
|
- if (use_swiotlb)
|
|
|
|
- return;
|
|
|
|
|
|
+ if (pci_swiotlb_detect())
|
|
|
|
+ goto out;
|
|
|
|
|
|
gart_iommu_hole_init();
|
|
gart_iommu_hole_init();
|
|
|
|
|
|
@@ -138,6 +135,8 @@ void __init pci_iommu_alloc(void)
|
|
|
|
|
|
/* needs to be called after gart_iommu_hole_init */
|
|
/* needs to be called after gart_iommu_hole_init */
|
|
amd_iommu_detect();
|
|
amd_iommu_detect();
|
|
|
|
+out:
|
|
|
|
+ pci_swiotlb_init();
|
|
}
|
|
}
|
|
|
|
|
|
void *dma_generic_alloc_coherent(struct device *dev, size_t size,
|
|
void *dma_generic_alloc_coherent(struct device *dev, size_t size,
|