From 540ad49319d31f598a017873b028ed0f01484145 Mon Sep 17 00:00:00 2001 From: Simon Xue Date: Tue, 7 Dec 2021 10:10:19 +0800 Subject: [PATCH] Revert "drm/rockchip: gem: add IOMMU_TLB_SHOT_ENTIRE when call iommu_map_sg" This reverts commit 91db0733d7cf2c83053c5eef8403a2ea8bcfca32. Signed-off-by: Simon Xue Change-Id: I7842de3f5a7e4a64e570ceb93e82fdee38f78498 --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 4 ---- drivers/iommu/iommu.c | 6 ------ drivers/iommu/rockchip-iommu.c | 12 ------------ include/linux/iommu.h | 7 ------- 4 files changed, 29 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 44a51f7bb9f8..9a55a12cfbf3 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -36,10 +36,6 @@ static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj) int prot = IOMMU_READ | IOMMU_WRITE; ssize_t ret; -#ifdef IOMMU_TLB_SHOT_ENTIRE - prot |= IOMMU_TLB_SHOT_ENTIRE; -#endif - mutex_lock(&private->mm_lock); ret = drm_mm_insert_node_generic(&private->mm, &rk_obj->mm, rk_obj->base.size, PAGE_SIZE, diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 8efea0bb6e52..0ee9e2cb0c12 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2636,12 +2636,6 @@ static size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova, if (ops->iotlb_sync_map) ops->iotlb_sync_map(domain, iova, mapped); - -#ifdef IOMMU_TLB_SHOT_ENTIRE - if (domain->ops->flush_iotlb_all && (prot & IOMMU_TLB_SHOT_ENTIRE)) - domain->ops->flush_iotlb_all(domain); -#endif - return mapped; out_err: diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 310686a05bca..a5e318c9cfbe 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -989,13 +989,7 @@ static int rk_iommu_map_iova(struct rk_iommu_domain *rk_domain, u32 *pte_addr, * We only zap the first and last iova, since only they could have * dte or pte shared with an existing mapping. */ -#ifdef IOMMU_TLB_SHOT_ENTIRE - /* Do not zap tlb cache line if IOMMU_TLB_SHOT_ENTIRE set */ - if (!(prot & IOMMU_TLB_SHOT_ENTIRE)) - rk_iommu_zap_iova_first_last(rk_domain, iova, size); -#else rk_iommu_zap_iova_first_last(rk_domain, iova, size); -#endif return 0; unwind: @@ -1040,13 +1034,7 @@ static int rk_iommu_map_iova_v2(struct rk_iommu_domain *rk_domain, u32 *pte_addr * We only zap the first and last iova, since only they could have * dte or pte shared with an existing mapping. */ -#ifdef IOMMU_TLB_SHOT_ENTIRE - /* Do not zap tlb cache line if IOMMU_TLB_SHOT_ENTIRE set */ - if (!(prot & IOMMU_TLB_SHOT_ENTIRE)) - rk_iommu_zap_iova_first_last(rk_domain, iova, size); -#else rk_iommu_zap_iova_first_last(rk_domain, iova, size); -#endif return 0; unwind: diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 3b97491ed0a3..2476f1a97fb6 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -44,13 +44,6 @@ */ #define IOMMU_SYS_CACHE_NWA (1 << 7) -#ifdef CONFIG_NO_GKI - -/* For shoting entire IOMMU tlb once */ -#define IOMMU_TLB_SHOT_ENTIRE (1 << 8) - -#endif - struct iommu_ops; struct iommu_group; struct bus_type;