linux-mips
[Top] [All Lists]

Re: fix oops in dma_unmap_page on not coherent mips platforms

To: jan.nikitenko@gmail.com
Subject: Re: fix oops in dma_unmap_page on not coherent mips platforms
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sat, 27 Dec 2008 00:07:13 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <20081128075258.GA10200@nikitenko.systek.local>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20081128075258.GA10200@nikitenko.systek.local>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 28 Nov 2008 08:52:58 +0100, Jan Nikitenko <jan.nikitenko@gmail.com> 
wrote:
> 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>
> ---
>  arch/mips/mm/dma-default.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
> index 5b98d0e..5f336c1 100644
> --- a/arch/mips/mm/dma-default.c
> +++ b/arch/mips/mm/dma-default.c
> @@ -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);
>       }

Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

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

<Prev in Thread] Current Thread [Next in Thread>
  • Re: fix oops in dma_unmap_page on not coherent mips platforms, Atsushi Nemoto <=