提交 935e4739 编写于 作者: H Hiroshi DOYU 提交者: Tony Lindgren

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: NHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 58a5491c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册