MIPS: Fix oops in dma_unmap_page on not coherent mips platforms
authorJan Nikitenko <jan.nikitenko@gmail.com>
Fri, 28 Nov 2008 07:52:58 +0000 (08:52 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 23 Mar 2009 22:38:04 +0000 (23:38 +0100)
dma_cache_wback_inv() expects virtual address, but physical was provided
due to translation via plat_dma_addr_to_phys().
If replaced with dma_addr_to_virt(), page fault oops from dma_unmap_page()
is gone on au1550 platform.

Signed-off-by: Jan Nikitenko <jan.nikitenko@gmail.com>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/dma-default.c

index 546e6977d4ffb0bd1910a57114803bdb1bffe858..bed56f1ac83709887aa1c4b60922d9fa6602d354 100644 (file)
@@ -225,7 +225,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
        if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
                unsigned long addr;
 
-               addr = plat_dma_addr_to_phys(dma_address);
+               addr = dma_addr_to_virt(dma_address);
                dma_cache_wback_inv(addr, size);
        }