From: Ohad Ben-Cohen Date: Fri, 2 Sep 2011 17:32:34 +0000 (-0400) Subject: iommu/msm: ->unmap() should return order of unmapped page X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9e28547f887c3040747d8422e1feef79bea93bd8;p=linux-beck.git 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 --- 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;