Skip to content

Commit 628bf55

Browse files
rmurphy-armwilldeacon
authored andcommitted
iommu/arm-smmu: Force identity domains for legacy binding
When using the legacy "mmu-masters" DT binding, we reject DMA domains since we have no guarantee of driver probe order and thus can't rely on client drivers getting the correct DMA ops. However, we can do better than fall back to the old no-default-domain behaviour now, by forcing an identity default domain instead. This also means that detaching from a VFIO domain can actually work - that looks to have been broken for over 6 years, so clearly isn't something that legacy binding users care about, but we may as well make the driver code make sense anyway. Suggested-by: Jason Gunthorpe <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/9805e4c492cb972bdcdd57999d2d001a2d8b5aab.1652171938.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 5ca2161 commit 628bf55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/iommu/arm/arm-smmu/arm-smmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,9 @@ static int arm_smmu_def_domain_type(struct device *dev)
15741574
struct arm_smmu_master_cfg *cfg = dev_iommu_priv_get(dev);
15751575
const struct arm_smmu_impl *impl = cfg->smmu->impl;
15761576

1577+
if (using_legacy_binding)
1578+
return IOMMU_DOMAIN_IDENTITY;
1579+
15771580
if (impl && impl->def_domain_type)
15781581
return impl->def_domain_type(dev);
15791582

0 commit comments

Comments
 (0)