linux-mips
[Top] [All Lists]

fix oops in dma_unmap_page on not coherent mips platforms

To: Ralf Baechle <ralf@linux-mips.org>
Subject: fix oops in dma_unmap_page on not coherent mips platforms
From: Jan Nikitenko <jan.nikitenko@gmail.com>
Date: Fri, 28 Nov 2008 08:52:58 +0100
Cc: linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=/9FTYiVkkzF9Rxqtd8okiSajwMtqEcMhbrx2A0EIpGU=; b=eLGcP5Vov2GbClVnBVaLphVCofm9B83yp2ZOVztxcCX8FKY/07PQjB7Bdj/LtZR2Jo KTRvMB6fHkWZnAg2AdgV1qktNrGimfU6Vfc+w2w92kI8lYwjbfzb/ze7x8EKyPO95Q48 fYb1IVPtOC1u3zDkmeisfGXC1zHbhDkEU6NRk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=jkOZA1n/6xKhKCvTxItKGwUg3JGCJUwiVOtAdvlx9wbzYSOauQeapU3/lHJ7WZs+bn ZvpsmwX26jP4WvIawpVBYIdKQAIenpYyuvVfeSU4hdhuzM3Y42pA3tuvDIZRSAkJhwpV 2912ktWxbs9KUN+/olFZb8DEpvK5h/TYtbi3Q=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.16 (2007-06-09)
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);
        }
 

<Prev in Thread] Current Thread [Next in Thread>
  • fix oops in dma_unmap_page on not coherent mips platforms, Jan Nikitenko <=