[v1,4/4] iommu/tegra: gart: Correct number of unmapped bytes

Message ID f30500403195b029ee236fff3b3c6f0b4dc60cbb.1499270277.git.digetx@gmail.com
State New
Headers show

Commit Message

Dmitry Osipenko July 5, 2017, 4:29 p.m.
The iommu_unmap() treats zero bytes number returned by an IOMMU driver as
an indicator that unmapping should be stopped. As a result, GART driver
unmaps only the first page entry of the whole range, which is incorrect.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
 drivers/iommu/tegra-gart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 55fdb56d85ea..c622f4a4bedd 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -309,7 +309,7 @@  static size_t gart_iommu_unmap(struct iommu_domain *domain, unsigned long iova,
 	gart_set_pte(gart, iova, 0);
 	spin_unlock_irqrestore(&gart->pte_lock, flags);
-	return 0;
+	return bytes;
 static phys_addr_t gart_iommu_iova_to_phys(struct iommu_domain *domain,