]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
microblaze: Fix mmap for cache coherent memory
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 3 Dec 2014 15:07:28 +0000 (16:07 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 17 Dec 2014 11:59:59 +0000 (12:59 +0100)
commit3a8e3265179b7e6394d7aab4d6df5651b49e7243
tree82194a886cb05fe27ba3ddf0dca4ec05c3977e4a
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d
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 <lars@metafoo.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/include/asm/pgtable.h
arch/microblaze/kernel/dma.c
arch/microblaze/mm/consistent.c