diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-07-28 10:58:50 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-07-30 04:28:48 -0400 |
commit | 323023245771589c53869396e3297c703d347852 (patch) | |
tree | 2a306888cba9e332b1edb0387d5001e75cb668f3 | |
parent | 02ca20212f0dde5c90be8de19cc159726b5561aa (diff) |
iommu/amd: Use swiotlb in passthrough mode
In passthrough mode (iommu=pt) all devices are identity
mapped. If a device does not support 64bit DMA it might
still need remapping. Make sure swiotlb is initialized to
provide this remapping.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | drivers/iommu/amd_iommu.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 6d3dae962867..e29baa6c64e3 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2282,12 +2282,10 @@ static int amd_iommu_add_device(struct device *dev) | |||
2282 | 2282 | ||
2283 | /* Domains are initialized for this device - have a look what we ended up with */ | 2283 | /* Domains are initialized for this device - have a look what we ended up with */ |
2284 | domain = iommu_get_domain_for_dev(dev); | 2284 | domain = iommu_get_domain_for_dev(dev); |
2285 | if (domain->type == IOMMU_DOMAIN_IDENTITY) { | 2285 | if (domain->type == IOMMU_DOMAIN_IDENTITY) |
2286 | dev_data->passthrough = true; | 2286 | dev_data->passthrough = true; |
2287 | dev->archdata.dma_ops = &nommu_dma_ops; | 2287 | else |
2288 | } else { | ||
2289 | dev->archdata.dma_ops = &amd_iommu_dma_ops; | 2288 | dev->archdata.dma_ops = &amd_iommu_dma_ops; |
2290 | } | ||
2291 | 2289 | ||
2292 | out: | 2290 | out: |
2293 | iommu_completion_wait(iommu); | 2291 | iommu_completion_wait(iommu); |
@@ -2852,8 +2850,8 @@ int __init amd_iommu_init_api(void) | |||
2852 | 2850 | ||
2853 | int __init amd_iommu_init_dma_ops(void) | 2851 | int __init amd_iommu_init_dma_ops(void) |
2854 | { | 2852 | { |
2853 | swiotlb = iommu_pass_through ? 1 : 0; | ||
2855 | iommu_detected = 1; | 2854 | iommu_detected = 1; |
2856 | swiotlb = 0; | ||
2857 | 2855 | ||
2858 | amd_iommu_stats_init(); | 2856 | amd_iommu_stats_init(); |
2859 | 2857 | ||