Skip to content

Commit b155e26

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/mtk: 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 finalise. Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[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 cf39047 commit b155e26

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,15 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_domain *dom,
648648
if (share_dom) {
649649
dom->iop = share_dom->iop;
650650
dom->cfg = share_dom->cfg;
651-
dom->domain.pgsize_bitmap = share_dom->cfg.pgsize_bitmap;
651+
dom->domain.pgsize_bitmap = share_dom->domain.pgsize_bitmap;
652652
goto update_iova_region;
653653
}
654654

655655
dom->cfg = (struct io_pgtable_cfg) {
656656
.quirks = IO_PGTABLE_QUIRK_ARM_NS |
657657
IO_PGTABLE_QUIRK_NO_PERMS |
658658
IO_PGTABLE_QUIRK_ARM_MTK_EXT,
659-
.pgsize_bitmap = mtk_iommu_ops.pgsize_bitmap,
659+
.pgsize_bitmap = dom->domain.pgsize_bitmap,
660660
.ias = MTK_IOMMU_HAS_FLAG(data->plat_data, IOVA_34_EN) ? 34 : 32,
661661
.iommu_dev = data->dev,
662662
};
@@ -675,9 +675,6 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_domain *dom,
675675
return -ENOMEM;
676676
}
677677

678-
/* Update our support page sizes bitmap */
679-
dom->domain.pgsize_bitmap = dom->cfg.pgsize_bitmap;
680-
681678
data->share_dom = dom;
682679

683680
update_iova_region:
@@ -697,6 +694,7 @@ static struct iommu_domain *mtk_iommu_domain_alloc_paging(struct device *dev)
697694
if (!dom)
698695
return NULL;
699696
mutex_init(&dom->mutex);
697+
dom->domain.pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M;
700698

701699
return &dom->domain;
702700
}
@@ -1019,7 +1017,6 @@ static const struct iommu_ops mtk_iommu_ops = {
10191017
.device_group = mtk_iommu_device_group,
10201018
.of_xlate = mtk_iommu_of_xlate,
10211019
.get_resv_regions = mtk_iommu_get_resv_regions,
1022-
.pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M,
10231020
.owner = THIS_MODULE,
10241021
.default_domain_ops = &(const struct iommu_domain_ops) {
10251022
.attach_dev = mtk_iommu_attach_device,

0 commit comments

Comments
 (0)