diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-07-28 16:58:50 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-07-30 10:28:48 +0200 |
commit | 323023245771589c53869396e3297c703d347852 (patch) | |
tree | 2a306888cba9e332b1edb0387d5001e75cb668f3 /drivers/iommu | |
parent | iommu/amd: Allow non-IOMMUv2 devices in IOMMUv2 domains (diff) | |
download | linux-323023245771589c53869396e3297c703d347852.tar.xz linux-323023245771589c53869396e3297c703d347852.zip |
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>
Diffstat (limited to 'drivers/iommu')
-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) /* Domains are initialized for this device - have a look what we ended up with */ domain = iommu_get_domain_for_dev(dev); - if (domain->type == IOMMU_DOMAIN_IDENTITY) { + if (domain->type == IOMMU_DOMAIN_IDENTITY) dev_data->passthrough = true; - dev->archdata.dma_ops = &nommu_dma_ops; - } else { + else dev->archdata.dma_ops = &amd_iommu_dma_ops; - } out: iommu_completion_wait(iommu); @@ -2852,8 +2850,8 @@ int __init amd_iommu_init_api(void) int __init amd_iommu_init_dma_ops(void) { + swiotlb = iommu_pass_through ? 1 : 0; iommu_detected = 1; - swiotlb = 0; amd_iommu_stats_init(); |