Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f8e33546d17c7d8849be3a6623c3b6b3c9b588b
Commit:     7f8e33546d17c7d8849be3a6623c3b6b3c9b588b
Parent:     56660faf9e8088542e85207df45fb9c5f4dd3909
Author:     Russell King <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 6 17:29:53 2007 +0000
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu Feb 8 14:49:37 2007 +0000

    [ARM] Don't call consistent_sync() for DMA coherent memory
    
    Memory allocated by the coherent memory allocators will be marked
    uncacheable, which means it's pointless calling consistent_sync()
    to perform cache maintainence on this memory; it's just a waste of
    CPU cycles.
    
    Moreover, with the (subsequent) merge of outer cache support, it
    actually breaks things to call consistent_sync() on anything but
    direct-mapped memory.
    
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/common/dmabounce.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 2e635b8..272702a 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -281,10 +281,14 @@ map_single(struct device *dev, void *ptr, size_t size,
                ptr = buf->safe;
 
                dma_addr = buf->safe_dma_addr;
+       } else {
+               /*
+                * We don't need to sync the DMA buffer since
+                * it was allocated via the coherent allocators.
+                */
+               consistent_sync(ptr, size, dir);
        }
 
-       consistent_sync(ptr, size, dir);
-
        return dma_addr;
 }
 
@@ -397,7 +401,10 @@ sync_single(struct device *dev, dma_addr_t dma_addr, 
size_t size,
                default:
                        BUG();
                }
-               consistent_sync(buf->safe, size, dir);
+               /*
+                * No need to sync the safe buffer - it was allocated
+                * via the coherent allocators.
+                */
        } else {
                consistent_sync(dma_to_virt(dev, dma_addr), size, dir);
        }
-
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