iommu/mediatek: Fix 2 HW sharing pgtable issue
authorYong Wu <yong.wu@mediatek.com>
Tue, 3 May 2022 07:13:55 +0000 (15:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:13 +0000 (10:23 +0200)
commitbf45d764616a02a1dd5bd019cd5e563204b264ff
tree7747765800cd4be949760d4eaaa1032fa0a82002
parent9e53c25f326604c838d528b430b8e603944b9e28
iommu/mediatek: Fix 2 HW sharing pgtable issue

[ Upstream commit 645b87c190c959e9bb4f216b8c4add4ee880451a ]

In the commit 4f956c97d26b ("iommu/mediatek: Move domain_finalise into
attach_device"), I overlooked the sharing pgtable case.
After that commit, the "data" in the mtk_iommu_domain_finalise always is
the data of the current IOMMU HW. Fix this for the sharing pgtable case.

Only affect mt2712 which is the only SoC that share pgtable currently.

Fixes: 4f956c97d26b ("iommu/mediatek: Move domain_finalise into attach_device")
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20220503071427.2285-5-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/mtk_iommu.c