Skip to content

Commit b7875eb

Browse files
YongWu-HFwilldeacon
authored andcommitted
iommu/mediatek: Move geometry.aperture updating into domain_finalise
Move the domain geometry.aperture updating into domain_finalise. This is a preparing patch for updating the domain region. We know the detailed iova region in the attach_device. Signed-off-by: Yong Wu <yong.wu@mediatek.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Link: https://lore.kernel.org/r/20210111111914.22211-26-yong.wu@mediatek.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 4f956c9 commit b7875eb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_domain *dom,
353353

354354
/* Update our support page sizes bitmap */
355355
dom->domain.pgsize_bitmap = dom->cfg.pgsize_bitmap;
356+
357+
dom->domain.geometry.aperture_start = 0;
358+
dom->domain.geometry.aperture_end = DMA_BIT_MASK(32);
359+
dom->domain.geometry.force_aperture = true;
356360
return 0;
357361
}
358362

@@ -372,9 +376,6 @@ static struct iommu_domain *mtk_iommu_domain_alloc(unsigned type)
372376
return NULL;
373377
}
374378

375-
dom->domain.geometry.aperture_start = 0;
376-
dom->domain.geometry.aperture_end = DMA_BIT_MASK(32);
377-
dom->domain.geometry.force_aperture = true;
378379
return &dom->domain;
379380
}
380381

0 commit comments

Comments
 (0)