From de3112ba6a92fc56c8861f7deabb7db1c487e775 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 14 Jun 2017 03:50:39 +0200 Subject: Only set pgprot_noncached for consistent buffers --- driver/kmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'driver') diff --git a/driver/kmem.c b/driver/kmem.c index 522f3bc..c1282be 100644 --- a/driver/kmem.c +++ b/driver/kmem.c @@ -616,8 +616,10 @@ int pcidriver_mmap_kmem(pcidriver_privdata_t *privdata, struct vm_area_struct *v vma->vm_flags |= (VM_RESERVED); + if ((kmem_entry->type&&PCILIB_KMEM_TYPE_MASK) == PCILIB_KMEM_TYPE_CONSISTENT) { // This is coherent memory, so it must not be cached. - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + } mod_info_dbg("Mapping address %08lx / PFN %08lx\n", virt_to_phys((void*)kmem_entry->cpua), -- cgit v1.2.3