iommu/mediatek: Add mutex for m4u_group and m4u_dom in data
authorYong Wu <yong.wu@mediatek.com>
Tue, 3 May 2022 07:13:58 +0000 (15:13 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 May 2022 08:39:38 +0000 (10:39 +0200)
commit0e5a3f2e630b28e88e018655548212ef8eb4dfcb
treea46a14b28bb9955852d25b13d7ac9c3571916123
parent98df772bdd1c4ce717a26289efea15cbbe4b64ed
iommu/mediatek: Add mutex for m4u_group and m4u_dom in data

Add a mutex to protect the data in the structure mtk_iommu_data,
like ->"m4u_group" ->"m4u_dom". For the internal data, we should
protect it in ourselves driver. Add a mutex for this.
This could be a fix for the multi-groups support.

Fixes: c3045f39244e ("iommu/mediatek: Support for multi domains")
Signed-off-by: Yunfei Wang <yf.wang@mediatek.com>
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-8-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c
drivers/iommu/mtk_iommu.h