From 3a8e3265179b7e6394d7aab4d6df5651b49e7243 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 3 Dec 2014 16:07:28 +0100 Subject: microblaze: Fix mmap for cache coherent memory When running in non-cache coherent configuration the memory that was allocated with dma_alloc_coherent() has a custom mapping and so there is no 1-to-1 relationship between the kernel virtual address and the PFN. This means that virt_to_pfn() will not work correctly for those addresses and the default mmap implementation in the form of dma_common_mmap() will map some random, but not the requested, memory area. Fix this by providing a custom mmap implementation that looks up the PFN from the page table rather than using virt_to_pfn. Signed-off-by: Lars-Peter Clausen Signed-off-by: Michal Simek --- arch/microblaze/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h index 95cef0b5f836..df19d0c47be8 100644 --- a/arch/microblaze/include/asm/pgtable.h +++ b/arch/microblaze/include/asm/pgtable.h @@ -565,6 +565,7 @@ void consistent_free(size_t size, void *vaddr); void consistent_sync(void *vaddr, size_t size, int direction); void consistent_sync_page(struct page *page, unsigned long offset, size_t size, int direction); +unsigned long consistent_virt_to_pfn(void *vaddr); void setup_memory(void); #endif /* __ASSEMBLY__ */ -- cgit v1.2.3