[PATCH 4/8] etnaviv: iommuv1: remove map_lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It wasn't protecting anything, as the single word writes used to
set up or tear down a translation are already inherently atomic,
so the spinlock is pure overhead.

Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/gpu/drm/etnaviv/etnaviv_iommu.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c
index aaa8c4136f53..78a7c0f3064a 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c
@@ -42,7 +42,6 @@ struct etnaviv_iommu_domain {
 	void *bad_page_cpu;
 	dma_addr_t bad_page_dma;
 	struct etnaviv_iommu_domain_pgtable pgtable;
-	spinlock_t map_lock;
 };
 
 static struct etnaviv_iommu_domain *to_etnaviv_domain(struct iommu_domain *domain)
@@ -90,8 +89,6 @@ static int __etnaviv_iommu_init(struct etnaviv_iommu_domain *etnaviv_domain)
 		etnaviv_domain->pgtable.pgtable[i] =
 			etnaviv_domain->bad_page_dma;
 
-	spin_lock_init(&etnaviv_domain->map_lock);
-
 	return 0;
 }
 
@@ -118,9 +115,7 @@ static int etnaviv_iommuv1_map(struct iommu_domain *domain, unsigned long iova,
 	if (size != SZ_4K)
 		return -EINVAL;
 
-	spin_lock(&etnaviv_domain->map_lock);
 	pgtable_write(&etnaviv_domain->pgtable, iova, paddr);
-	spin_unlock(&etnaviv_domain->map_lock);
 
 	return 0;
 }
@@ -133,10 +128,8 @@ static size_t etnaviv_iommuv1_unmap(struct iommu_domain *domain,
 	if (size != SZ_4K)
 		return -EINVAL;
 
-	spin_lock(&etnaviv_domain->map_lock);
 	pgtable_write(&etnaviv_domain->pgtable, iova,
 		      etnaviv_domain->bad_page_dma);
-	spin_unlock(&etnaviv_domain->map_lock);
 
 	return SZ_4K;
 }
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux