Skip to content

Commit

Permalink
omap: iommu: avoid remapping if it's been mapped in MPU side
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hiroshi DOYU authored and Tony Lindgren committed Nov 22, 2009
1 parent 58a5491 commit 935e473
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/arm/plat-omap/iovmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 935e473

Please sign in to comment.