From patchwork Fri Sep 2 17:32:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 1122752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p82HYKAA029325 for ; Fri, 2 Sep 2011 17:34:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753811Ab1IBRdz (ORCPT ); Fri, 2 Sep 2011 13:33:55 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:41213 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803Ab1IBRdM (ORCPT ); Fri, 2 Sep 2011 13:33:12 -0400 Received: by mail-wy0-f174.google.com with SMTP id 22so2141299wyh.19 for ; Fri, 02 Sep 2011 10:33:11 -0700 (PDT) Received: by 10.227.163.71 with SMTP id z7mr1326195wbx.24.1314984791596; Fri, 02 Sep 2011 10:33:11 -0700 (PDT) Received: from localhost.localdomain (93-173-174-182.bb.netvision.net.il [93.173.174.182]) by mx.google.com with ESMTPS id fq2sm2376189wbb.24.2011.09.02.10.33.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Sep 2011 10:33:11 -0700 (PDT) From: Ohad Ben-Cohen To: Cc: , Hiroshi DOYU , Laurent Pinchart , Joerg Roedel , David Woodhouse , , David Brown , Arnd Bergmann , , Ohad Ben-Cohen , Stepan Moskovchenko Subject: [PATCH 5/7] iommu/msm: ->unmap() should return order of unmapped page Date: Fri, 2 Sep 2011 20:32:34 +0300 Message-Id: <1314984756-4400-6-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314984756-4400-1-git-send-email-ohad@wizery.com> References: <1314984756-4400-1-git-send-email-ohad@wizery.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 02 Sep 2011 17:34:20 +0000 (UTC) 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 --- drivers/iommu/msm_iommu.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 1a584e0..d1733f6 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;