diff options
author | Sunil Goutham <sgoutham@cavium.com> | 2017-04-25 15:27:52 +0530 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-04-26 12:30:10 +0200 |
commit | bdf95923086fb359ccb44c815724c3ace1611c90 (patch) | |
tree | cc463fbb7747b233592ab2ec51aa8606a8f41b99 /drivers/iommu/arm-smmu-v3.c | |
parent | 6323f474902e372623d73486c1ad30eb40d6604f (diff) | |
download | op-kernel-dev-bdf95923086fb359ccb44c815724c3ace1611c90.zip op-kernel-dev-bdf95923086fb359ccb44c815724c3ace1611c90.tar.gz |
iommu/arm-smmu: Return IOVA in iova_to_phys when SMMU is bypassed
For software initiated address translation, when domain type is
IOMMU_DOMAIN_IDENTITY i.e SMMU is bypassed, mimic HW behavior
i.e return the same IOVA as translated address.
This patch is an extension to Will Deacon's patchset
"Implement SMMU passthrough using the default domain".
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/arm-smmu-v3.c')
-rw-r--r-- | drivers/iommu/arm-smmu-v3.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 803352d..6ef9c3e 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1714,6 +1714,9 @@ arm_smmu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops; + if (domain->type == IOMMU_DOMAIN_IDENTITY) + return iova; + if (!ops) return 0; |