arm64: Implement custom mmap functions for dma mapping
authorLaura Abbott <lauraa@codeaurora.org>
Fri, 14 Mar 2014 19:52:23 +0000 (19:52 +0000)
committerMark Brown <broonie@linaro.org>
Wed, 21 May 2014 18:04:26 +0000 (19:04 +0100)
commit0d2f4e91d89ece1556224ddef344867a572c69f9
tree90f2228f70a454b4efb5acff13494d0217985a20
parent3abb7f235bacff959dc5a12c4ef77a4f358d2dc5
arm64: Implement custom mmap functions for dma mapping

The current dma_ops do not specify an mmap function so maping
falls back to the default implementation. There are at least
two issues with using the default implementation:

1) The pgprot is always pgprot_noncached (strongly ordered)
memory even with coherent operations
2) dma_common_mmap calls virt_to_page on the remapped non-coherent
address which leads to invalid memory being mapped.

Fix both these issue by implementing a custom mmap function which
correctly accounts for remapped addresses and sets vm_pg_prot
appropriately.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[catalin.marinas@arm.com: replaced "arm64_" with "__" prefix for consistency]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6e8d7968e92f7668a2a615773ad3940f0219dcbd)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/mm/dma-mapping.c