linux-mips
[Top] [All Lists]

[Patch] MIPS: Add missing calls to plat_unmap_dma_mem.

To: linux-mips <linux-mips@linux-mips.org>
Subject: [Patch] MIPS: Add missing calls to plat_unmap_dma_mem.
From: David Daney <ddaney@caviumnetworks.com>
Date: Wed, 10 Dec 2008 18:14:45 -0800
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.18 (X11/20081119)
It appears that dma_free_noncoherent() and dma_free_coherent() are
missing calls to plat_unmap_dma_mem().  This patch adds them.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
This is split out from my OCTEON processor support patch at Ralf's
request.

arch/mips/mm/dma-default.c |    3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 5b98d0e..e6708b3 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -111,6 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
        dma_addr_t dma_handle)
{
+       plat_unmap_dma_mem(dma_handle);
        free_pages((unsigned long) vaddr, get_order(size));
}

@@ -121,6 +122,8 @@ void dma_free_coherent(struct device *dev, size_t size, 
void *vaddr,
{
        unsigned long addr = (unsigned long) vaddr;

+       plat_unmap_dma_mem(dma_handle);
+
        if (!plat_device_is_coherent(dev))
                addr = CAC_ADDR(addr);


<Prev in Thread] Current Thread [Next in Thread>