Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a492dbb9e3d04db138f2841648d1904d38a5295d
Commit:     a492dbb9e3d04db138f2841648d1904d38a5295d
Parent:     e89b064a4fd18b9c57b7aecbe7101d782759cf81
Author:     Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 20 14:41:13 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Wed May 9 08:48:39 2007 +0200

    [AVR32] Implement dma_{alloc,free}_writecombine()
    
    Implement dma_alloc_writecombine() and its dma_free_writecombine()
    counterpart. These will do basically the same thing as
    dma_alloc_coherent() except that the virtual mapping will allow
    write buffering, causing better performance for certain use cases
    like frame buffers.
    
    The same API is already available on ARM.
    
    Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/mm/dma-coherent.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/avr32/mm/dma-coherent.c b/arch/avr32/mm/dma-coherent.c
index b68d669..099212d 100644
--- a/arch/avr32/mm/dma-coherent.c
+++ b/arch/avr32/mm/dma-coherent.c
@@ -112,16 +112,21 @@ void dma_free_coherent(struct device *dev, size_t size,
 }
 EXPORT_SYMBOL(dma_free_coherent);
 
-#if 0
 void *dma_alloc_writecombine(struct device *dev, size_t size,
                             dma_addr_t *handle, gfp_t gfp)
 {
        struct page *page;
+       dma_addr_t phys;
 
        page = __dma_alloc(dev, size, handle, gfp);
+       if (!page)
+               return NULL;
+
+       phys = page_to_phys(page);
+       *handle = phys;
 
        /* Now, map the page into P3 with write-combining turned on */
-       return __ioremap(page_to_phys(page), size, _PAGE_BUFFER);
+       return __ioremap(phys, size, _PAGE_BUFFER);
 }
 EXPORT_SYMBOL(dma_alloc_writecombine);
 
@@ -132,8 +137,7 @@ void dma_free_writecombine(struct device *dev, size_t size,
 
        iounmap(cpu_addr);
 
-       page = bus_to_page(handle);
+       page = phys_to_page(handle);
        __dma_free(dev, size, page, handle);
 }
 EXPORT_SYMBOL(dma_free_writecombine);
-#endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to