summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/omap-iommu.c
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2011-09-02 13:32:33 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-09-05 15:14:37 +0200
commit5e1b612cb16f446996398bd23b6cd59ea0206938 (patch)
tree4278a81d31facf01da8d914bcd90e9573824fc32 /drivers/iommu/omap-iommu.c
parentb4550d415a2e1668822ebf3a12b481548756b4e3 (diff)
downloadop-kernel-dev-5e1b612cb16f446996398bd23b6cd59ea0206938.zip
op-kernel-dev-5e1b612cb16f446996398bd23b6cd59ea0206938.tar.gz
iommu/omap: ->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. Fix omap_iommu_unmap() to do so and adopt omap-iovmm accordingly. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/omap-iommu.c')
-rw-r--r--drivers/iommu/omap-iommu.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 4311bc3..bd5f606 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1081,18 +1081,13 @@ static int omap_iommu_unmap(struct iommu_domain *domain, unsigned long da,
struct omap_iommu_domain *omap_domain = domain->priv;
struct omap_iommu *oiommu = omap_domain->iommu_dev;
struct device *dev = oiommu->dev;
- size_t bytes = PAGE_SIZE << order;
- size_t ret;
+ size_t unmap_size;
- dev_dbg(dev, "unmapping da 0x%lx size 0x%x\n", da, bytes);
+ dev_dbg(dev, "unmapping da 0x%lx order %d\n", da, order);
- ret = iopgtable_clear_entry(oiommu, da);
- if (ret != bytes) {
- dev_err(dev, "entry @ 0x%lx was %d; not %d\n", da, ret, bytes);
- return -EINVAL;
- }
+ unmap_size = iopgtable_clear_entry(oiommu, da);
- return 0;
+ return unmap_size ? get_order(unmap_size) : -EINVAL;
}
static int
OpenPOWER on IntegriCloud