From: Alex Smith Date: Thu, 30 Jul 2015 11:03:42 +0000 (+0100) Subject: MIPS: Add implementation of dma_map_ops.mmap() X-Git-Tag: omap-for-v4.3/fixes-rc1~99^2~52 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c172467be36f7c9591e59b647e4cd342ce2ef41;p=pandora-kernel.git MIPS: Add implementation of dma_map_ops.mmap() The generic implementation of dma_map_ops.mmap(), dma_common_mmap(), is not correct for non-coherent devices. It expects to be passed a virtual address previously returned by dma_alloc_coherent(), which for a non-coherent device will return a KSEG1 address. It then attempts to convert that virtual address to a physical address using virt_to_page() which will yield an incorrect address. Also, dma_common_mmap() does not handle the DMA_ATTR_WRITE_COMBINE attribute, and therefore dma_mmap_writecombine() will not actually set the appropriate pgprot_t flags for write combining. This patch adds an implementation of dma_map_ops.mmap() that correctly handles KSEG1 addresses, and enables write combining when requested. Signed-off-by: Alex Smith Cc: Sadegh Abbasi Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/10808/ Signed-off-by: Ralf Baechle --- Reading git-diff-tree failed