fix oops in dma_unmap_page on not coherent mips platforms
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.
--- arch/mips/mm/dma-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/mm/dma-default.c +1 -1
@@ -222,7 +222,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); }
Atsushi Nemoto
Acked-byQuoted 15 lines · Jan Nikitenko
dma_cache_wback_inv()expects virtual address, but physical was provided due to translation viaplat_dma_addr_to_phys().
If replaced withdma_addr_to_virt(), page fault oops fromdma_unmap_page()is gone on au1550 platform.Signed-off-by Jan Nikitenko <[email protected]>--- arch/mips/mm/dma-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/mips/mm/dma-default.c +0
-0
arch/mips/mm/dma-default.c void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, · line 227
Quoted 7 lines
arch/mips/mm/dma-default.c +1
-1@@ -222,7 +222,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); }
I'm also wondering why dma_map_page and dma_unmap_page are using dma_cache_wback_inv instead of __dma_sync. They also lack special r10000 handling. Hmm...
---
Atsushi Nemoto
Ralf Baechle
AppliedQuoted 6 lines
dma_cache_wback_inv()expects virtual address, but physical was provided due to translation viaplat_dma_addr_to_phys().
If replaced withdma_addr_to_virt(), page fault oops fromdma_unmap_page()is gone on au1550 platform.Signed-off-by Jan Nikitenko <[email protected]>
Applied, finally ...
Ralf
Quoted 8 lines · Ralf Baechle
Quoted 6 lines
dma_cache_wback_inv()expects virtual address, but physical was provided due to translation viaplat_dma_addr_to_phys().
If replaced withdma_addr_to_virt(), page fault oops fromdma_unmap_page()is gone on au1550 platform.Signed-off-by Jan Nikitenko <[email protected]>Applied, finally ...
Good news!
And please take a look at this too:
http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=1232638931-6203-1-git-send-email-anemo%40mba.ocn.ne.jp
---
Atsushi Nemoto