Skip to content

Commit db64591

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/qcom: Remove iommu_ops pgsize_bitmap
This driver just uses a constant, put it in domain_alloc_paging and use the domain's value instead of ops during init_domain. Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Tested-by: Nicolin Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent b155e26 commit db64591

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain,
229229
goto out_unlock;
230230

231231
pgtbl_cfg = (struct io_pgtable_cfg) {
232-
.pgsize_bitmap = qcom_iommu_ops.pgsize_bitmap,
232+
.pgsize_bitmap = domain->pgsize_bitmap,
233233
.ias = 32,
234234
.oas = 40,
235235
.tlb = &qcom_flush_ops,
@@ -246,8 +246,6 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain,
246246
goto out_clear_iommu;
247247
}
248248

249-
/* Update the domain's page sizes to reflect the page table format */
250-
domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap;
251249
domain->geometry.aperture_end = (1ULL << pgtbl_cfg.ias) - 1;
252250
domain->geometry.force_aperture = true;
253251

@@ -337,6 +335,7 @@ static struct iommu_domain *qcom_iommu_domain_alloc_paging(struct device *dev)
337335

338336
mutex_init(&qcom_domain->init_mutex);
339337
spin_lock_init(&qcom_domain->pgtbl_lock);
338+
qcom_domain->domain.pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M;
340339

341340
return &qcom_domain->domain;
342341
}
@@ -598,7 +597,6 @@ static const struct iommu_ops qcom_iommu_ops = {
598597
.probe_device = qcom_iommu_probe_device,
599598
.device_group = generic_device_group,
600599
.of_xlate = qcom_iommu_of_xlate,
601-
.pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M,
602600
.default_domain_ops = &(const struct iommu_domain_ops) {
603601
.attach_dev = qcom_iommu_attach_dev,
604602
.map_pages = qcom_iommu_map,

0 commit comments

Comments
 (0)