Skip to content

Commit 232c5ae

Browse files
Sai Prakash Ranjanwilldeacon
authored andcommitted
iommu/arm-smmu: Implement iommu_ops->def_domain_type call-back
Implement the new def_domain_type call-back for the ARM SMMU driver. We need this to support requesting the domain type by the client devices. Signed-off-by: Sai Prakash Ranjan <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/28c5d101cc4ac29aff3553ecec7cf256d0907ed7.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon <[email protected]>
1 parent 64510ed commit 232c5ae

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/iommu/arm-smmu.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,17 @@ static void arm_smmu_get_resv_regions(struct device *dev,
16091609
iommu_dma_get_resv_regions(dev, head);
16101610
}
16111611

1612+
static int arm_smmu_def_domain_type(struct device *dev)
1613+
{
1614+
struct arm_smmu_master_cfg *cfg = dev_iommu_priv_get(dev);
1615+
const struct arm_smmu_impl *impl = cfg->smmu->impl;
1616+
1617+
if (impl && impl->def_domain_type)
1618+
return impl->def_domain_type(dev);
1619+
1620+
return 0;
1621+
}
1622+
16121623
static struct iommu_ops arm_smmu_ops = {
16131624
.capable = arm_smmu_capable,
16141625
.domain_alloc = arm_smmu_domain_alloc,
@@ -1627,6 +1638,7 @@ static struct iommu_ops arm_smmu_ops = {
16271638
.of_xlate = arm_smmu_of_xlate,
16281639
.get_resv_regions = arm_smmu_get_resv_regions,
16291640
.put_resv_regions = generic_iommu_put_resv_regions,
1641+
.def_domain_type = arm_smmu_def_domain_type,
16301642
.pgsize_bitmap = -1UL, /* Restricted during device attach */
16311643
};
16321644

drivers/iommu/arm-smmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ struct arm_smmu_impl {
386386
int (*init_context)(struct arm_smmu_domain *smmu_domain);
387387
void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync,
388388
int status);
389+
int (*def_domain_type)(struct device *dev);
389390
};
390391

391392
static inline void __iomem *arm_smmu_page(struct arm_smmu_device *smmu, int n)

0 commit comments

Comments
 (0)