iommu/mediatek: Move domain_finalise into attach_device
authorYong Wu <yong.wu@mediatek.com>
Mon, 11 Jan 2021 11:19:05 +0000 (19:19 +0800)
committerWill Deacon <will@kernel.org>
Mon, 1 Feb 2021 11:31:18 +0000 (11:31 +0000)
commit4f956c97d26be65aea580e943f470ec70f7b0bb6
tree844b04a366b883c8acd8f4469e62401272124fad
parent08500c43d4f70c1e8be6beda8a2aea0ecfb845d8
iommu/mediatek: Move domain_finalise into attach_device

Currently domain_alloc only has a parameter(type), We have no chance to
input some special data. This patch moves the domain_finalise into
attach_device which has the device information, then could update
the domain's geometry.aperture ranges for each a device.

Strictly, I should use the data from mtk_iommu_get_m4u_data as the
parameter of mtk_iommu_domain_finalise in this patch. but dom->data
only is used in tlb ops in which the data is get from the m4u_list, thus
it is ok here.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Link: https://lore.kernel.org/r/20210111111914.22211-25-yong.wu@mediatek.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/mtk_iommu.c