diff options
author | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2009-11-22 21:11:02 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-11-22 21:24:32 +0300 |
commit | 935e4739fc4817b1044fdbeed5fe19aee9f03f45 (patch) | |
tree | 82c3328d9d799cde8c64e126e219e4493f395e45 /arch/arm/plat-omap/iovmm.c | |
parent | 58a5491c936957011c92f8cc5097fb3231ee3f9c (diff) | |
download | linux-935e4739fc4817b1044fdbeed5fe19aee9f03f45.tar.xz |
omap: iommu: avoid remapping if it's been mapped in MPU side
MPU side (v)-(p) mapping is necessary only if IOVMF_MMIO is set in
"flags".
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/iovmm.c')
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 0ce36bbef9d2..577d8c03b8e1 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c @@ -617,7 +617,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, u32 flags) { size_t bytes; - void *va; + void *va = NULL; if (!obj || !obj->dev || !sgt) return -EINVAL; @@ -627,9 +627,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, return -EINVAL; bytes = PAGE_ALIGN(bytes); - va = vmap_sg(sgt); - if (IS_ERR(va)) - return PTR_ERR(va); + if (flags & IOVMF_MMIO) { + va = vmap_sg(sgt); + if (IS_ERR(va)) + return PTR_ERR(va); + } flags &= IOVMF_HW_MASK; flags |= IOVMF_DISCONT; |