iommu/mediatek: Add list_del in mtk_iommu_remove
authorYong Wu <yong.wu@mediatek.com>
Tue, 3 May 2022 07:13:56 +0000 (15:13 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 May 2022 08:39:38 +0000 (10:39 +0200)
Lack the list_del in the mtk_iommu_remove, and remove
bus_set_iommu(*, NULL) since there may be several iommu HWs.
we can not bus_set_iommu null when one iommu driver unbind.

This could be a fix for mt2712 which support 2 M4U HW and list them.

Fixes: 7c3a2ec02806 ("iommu/mediatek: Merge 2 M4U HWs into one iommu domain")
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-6-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c

index 95c82b8bcc35bd37ff7bed165061be9a6ffe2435..e4b4ebbcb73fcf61e4e5f63e9df3ab092c086c50 100644 (file)
@@ -955,8 +955,7 @@ static int mtk_iommu_remove(struct platform_device *pdev)
        iommu_device_sysfs_remove(&data->iommu);
        iommu_device_unregister(&data->iommu);
 
-       if (iommu_present(&platform_bus_type))
-               bus_set_iommu(&platform_bus_type, NULL);
+       list_del(&data->list);
 
        clk_disable_unprepare(data->bclk);
        device_link_remove(data->smicomm_dev, &pdev->dev);