diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2011-11-10 04:32:25 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2011-11-10 05:40:37 -0500 |
commit | 5009065d38c95455bd2d27c2838313e3dd0c5bc7 (patch) | |
tree | a957af07e95166bcc014b3f333234fe74cef790e /drivers/iommu/omap-iommu.c | |
parent | 1ea6b8f48918282bdca0b32a34095504ee65bab5 (diff) |
iommu/core: stop converting bytes to page order back and forth
Express sizes in bytes rather than in page order, to eliminate the
size->order->size conversions we have whenever the IOMMU API is calling
the low level drivers' map/unmap methods.
Adopt all existing drivers.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Cc: David Brown <davidb@codeaurora.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <Joerg.Roedel@amd.com>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: KyongHo Cho <pullip.cho@samsung.com>
Cc: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.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.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 8f32b2bf7587..ad80b1d0d099 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c | |||
@@ -1019,12 +1019,11 @@ static void iopte_cachep_ctor(void *iopte) | |||
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | static int omap_iommu_map(struct iommu_domain *domain, unsigned long da, | 1021 | static int omap_iommu_map(struct iommu_domain *domain, unsigned long da, |
1022 | phys_addr_t pa, int order, int prot) | 1022 | phys_addr_t pa, size_t bytes, int prot) |
1023 | { | 1023 | { |
1024 | struct omap_iommu_domain *omap_domain = domain->priv; | 1024 | struct omap_iommu_domain *omap_domain = domain->priv; |
1025 | struct omap_iommu *oiommu = omap_domain->iommu_dev; | 1025 | struct omap_iommu *oiommu = omap_domain->iommu_dev; |
1026 | struct device *dev = oiommu->dev; | 1026 | struct device *dev = oiommu->dev; |
1027 | size_t bytes = PAGE_SIZE << order; | ||
1028 | struct iotlb_entry e; | 1027 | struct iotlb_entry e; |
1029 | int omap_pgsz; | 1028 | int omap_pgsz; |
1030 | u32 ret, flags; | 1029 | u32 ret, flags; |
@@ -1049,19 +1048,16 @@ static int omap_iommu_map(struct iommu_domain *domain, unsigned long da, | |||
1049 | return ret; | 1048 | return ret; |
1050 | } | 1049 | } |
1051 | 1050 | ||
1052 | static int omap_iommu_unmap(struct iommu_domain *domain, unsigned long da, | 1051 | static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da, |
1053 | int order) | 1052 | size_t size) |
1054 | { | 1053 | { |
1055 | struct omap_iommu_domain *omap_domain = domain->priv; | 1054 | struct omap_iommu_domain *omap_domain = domain->priv; |
1056 | struct omap_iommu *oiommu = omap_domain->iommu_dev; | 1055 | struct omap_iommu *oiommu = omap_domain->iommu_dev; |
1057 | struct device *dev = oiommu->dev; | 1056 | struct device *dev = oiommu->dev; |
1058 | size_t unmap_size; | ||
1059 | 1057 | ||
1060 | dev_dbg(dev, "unmapping da 0x%lx order %d\n", da, order); | 1058 | dev_dbg(dev, "unmapping da 0x%lx size %u\n", da, size); |
1061 | 1059 | ||
1062 | unmap_size = iopgtable_clear_entry(oiommu, da); | 1060 | return iopgtable_clear_entry(oiommu, da); |
1063 | |||
1064 | return unmap_size ? get_order(unmap_size) : -EINVAL; | ||
1065 | } | 1061 | } |
1066 | 1062 | ||
1067 | static int | 1063 | static int |