From 9e28547f887c3040747d8422e1feef79bea93bd8 Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen Date: Fri, 2 Sep 2011 13:32:34 -0400 Subject: [PATCH] iommu/msm: ->unmap() should return order of unmapped page Users of the IOMMU API (kvm specifically) assume that iommu_unmap() returns the order of the unmapped page (on success). Fix msm_iommu_unmap() accordingly. Signed-off-by: Ohad Ben-Cohen Cc: Stepan Moskovchenko Cc: David Brown Acked-by: David Brown Signed-off-by: Joerg Roedel --- drivers/iommu/msm_iommu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 1a584e077c61..d1733f672f16 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -543,6 +543,13 @@ static int msm_iommu_unmap(struct iommu_domain *domain, unsigned long va, } ret = __flush_iotlb(domain); + + /* + * the IOMMU API requires us to return the order of the unmapped + * page (on success). + */ + if (!ret) + ret = order; fail: spin_unlock_irqrestore(&msm_iommu_lock, flags); return ret; -- 2.20.1