aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2013-02-06 06:55:23 -0500
committerJoerg Roedel <joro@8bytes.org>2013-02-07 16:05:49 -0500
commitf528d980c17b8714aedc918ba86e058af914d66b (patch)
treeea899fb1e287775f2cf05735040f772ffca728e6
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
iommu/amd: Initialize device table after dma_ops
When dma_ops are initialized the unity mappings are created. The init_device_table_dma() function makes sure DMA from all devices is blocked by default. This opens a short window in time where DMA to unity mapped regions is blocked by the IOMMU. Make sure this does not happen by initializing the device table after dma_ops. Cc: stable@vger.kernel.org Signed-off-by: Joerg Roedel <joro@8bytes.org>
-rw-r--r--drivers/iommu/amd_iommu_init.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index faf10ba1ed9a..b6ecddb63cd0 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1876,11 +1876,6 @@ static int amd_iommu_init_dma(void)
1876 struct amd_iommu *iommu; 1876 struct amd_iommu *iommu;
1877 int ret; 1877 int ret;
1878 1878
1879 init_device_table_dma();
1880
1881 for_each_iommu(iommu)
1882 iommu_flush_all_caches(iommu);
1883
1884 if (iommu_pass_through) 1879 if (iommu_pass_through)
1885 ret = amd_iommu_init_passthrough(); 1880 ret = amd_iommu_init_passthrough();
1886 else 1881 else
@@ -1889,6 +1884,11 @@ static int amd_iommu_init_dma(void)
1889 if (ret) 1884 if (ret)
1890 return ret; 1885 return ret;
1891 1886
1887 init_device_table_dma();
1888
1889 for_each_iommu(iommu)
1890 iommu_flush_all_caches(iommu);
1891
1892 amd_iommu_init_api(); 1892 amd_iommu_init_api();
1893 1893
1894 amd_iommu_init_notifier(); 1894 amd_iommu_init_notifier();