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 <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 4f956c9 commit b7875eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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)