[COMMON] iommu/exynos: set sharable mapping for dma coherent device
authorhyesoo.yu <hyesoo.yu@samsung.com>
Sun, 3 Jun 2018 08:20:45 +0000 (17:20 +0900)
committerJanghyuck Kim <janghyuck.kim@samsung.com>
Mon, 23 Jul 2018 05:39:07 +0000 (14:39 +0900)
Change-Id: I9036ff34b860eb9bd698a4e8a938fca5d3dabb4e
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
drivers/iommu/exynos-iovmm.c

index 5fde22ac2788f71634bac9113b203c2a03c5438c..e16cd7068fc911b743e28afad14326da792ea187 100644 (file)
@@ -533,6 +533,8 @@ dma_addr_t exynos_iovmm_map_userptr(struct device *dev, unsigned long vaddr,
                (pgprot_val(pgprot_noncached(vma->vm_page_prot)) ==
                                        pgprot_val(vma->vm_page_prot)))
                prot &= ~IOMMU_CACHE;
+       else if (device_get_dma_attr(dev) == DEV_DMA_COHERENT)
+               prot |= IOMMU_CACHE;
 
        while (eaddr > vma->vm_end) {
                if (!!(vma->vm_flags & VM_PFNMAP)) {