mirror of
https://github.com/torvalds/linux.git
synced 2024-12-13 14:43:03 +00:00
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>
This commit is contained in:
parent
58a5491c93
commit
935e4739fc
@ -617,7 +617,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
|
|||||||
u32 flags)
|
u32 flags)
|
||||||
{
|
{
|
||||||
size_t bytes;
|
size_t bytes;
|
||||||
void *va;
|
void *va = NULL;
|
||||||
|
|
||||||
if (!obj || !obj->dev || !sgt)
|
if (!obj || !obj->dev || !sgt)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -627,9 +627,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
bytes = PAGE_ALIGN(bytes);
|
bytes = PAGE_ALIGN(bytes);
|
||||||
|
|
||||||
va = vmap_sg(sgt);
|
if (flags & IOVMF_MMIO) {
|
||||||
if (IS_ERR(va))
|
va = vmap_sg(sgt);
|
||||||
return PTR_ERR(va);
|
if (IS_ERR(va))
|
||||||
|
return PTR_ERR(va);
|
||||||
|
}
|
||||||
|
|
||||||
flags &= IOVMF_HW_MASK;
|
flags &= IOVMF_HW_MASK;
|
||||||
flags |= IOVMF_DISCONT;
|
flags |= IOVMF_DISCONT;
|
||||||
|
Loading…
Reference in New Issue
Block a user