From ea097296901ff7f3a1d11bd912a6653534fcc70d Mon Sep 17 00:00:00 2001 From: Ding Wei Date: Fri, 22 Oct 2021 18:11:29 +0800 Subject: [PATCH] video: rockchip: mpp: mpp_iommu_refresh via rockchip_iommu funcs reason: device_links_read_lock/unlock are not export symbols, thus use rockchip_iommu_disable/enable instead. Change-Id: I545eced499533383f6cfbdf81e696064f42b6c3e Signed-off-by: Ding Wei --- drivers/video/rockchip/mpp/mpp_iommu.c | 28 ++++++++------------------ 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/video/rockchip/mpp/mpp_iommu.c b/drivers/video/rockchip/mpp/mpp_iommu.c index 2e035aa5f8af..b9f10cd0c689 100644 --- a/drivers/video/rockchip/mpp/mpp_iommu.c +++ b/drivers/video/rockchip/mpp/mpp_iommu.c @@ -20,7 +20,7 @@ #include #include #include -#include "../../../base/base.h" +#include #include "mpp_debug.h" #include "mpp_iommu.h" @@ -460,27 +460,15 @@ int mpp_iommu_remove(struct mpp_iommu_info *info) int mpp_iommu_refresh(struct mpp_iommu_info *info, struct device *dev) { - int idx, i; - int usage_count; - struct device_link *link; - struct device *iommu_dev = &info->pdev->dev; + int ret; - idx = device_links_read_lock(); + /* disable iommu */ + ret = rockchip_iommu_disable(dev); + if (ret) + return ret; - usage_count = atomic_read(&iommu_dev->power.usage_count); - list_for_each_entry_rcu(link, &dev->links.suppliers, c_node) { - for (i = 0; i < usage_count; i++) - pm_runtime_put_sync(link->supplier); - } - - list_for_each_entry_rcu(link, &dev->links.suppliers, c_node) { - for (i = 0; i < usage_count; i++) - pm_runtime_get_sync(link->supplier); - } - - device_links_read_unlock(idx); - - return 0; + /* re-enable iommu */ + return rockchip_iommu_enable(dev); } int mpp_iommu_flush_tlb(struct mpp_iommu_info *info)