exynos_iovmm_map_userptr() migrates the given userspace mapping to the
device virtual address space. If the given mapping is uncached or
writecombine, cache lines that are allocated to some part of the given
range can be stale. Therefore the mapping is not cached, the mapping
to the System MMU page table should also be non-shareable.
Change-Id: I748ae92525c916d580cb55f9deeb9c43f03a6386
Signe-off-by: Cho KyongHo <pullip.cho@samsung.com>
if (!!(vma->vm_flags & VM_PFNMAP))
prot |= IOMMU_PFNMAP;
+ /* non-cached user mapping should be treated as non-shareable mapping */
+ if ((pgprot_val(pgprot_writecombine(vma->vm_page_prot)) ==
+ pgprot_val(vma->vm_page_prot)) ||
+ (pgprot_val(pgprot_noncached(vma->vm_page_prot)) ==
+ pgprot_val(vma->vm_page_prot)))
+ prot &= ~IOMMU_CACHE;
+
while (eaddr > vma->vm_end) {
if (!!(vma->vm_flags & VM_PFNMAP)) {
dev_err(dev, "%s: non-linear pfnmap is not supported\n",