Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f6627ac3ba6948a4aebec80edfd6565aec3a40c
Commit:     4f6627ac3ba6948a4aebec80edfd6565aec3a40c
Parent:     c2f828977ba5d17c13debba374ea252d18e5ccfb
Author:     Rui Sousa <[EMAIL PROTECTED]>
AuthorDate: Sat Sep 15 00:56:19 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Sep 17 14:56:39 2007 +0100

    [ARM] 4568/1: fix l2x0 cache invalidate handling of unaligned addresses
    
    The l2x0_inv_range() function doesn't handle unaligned addresses
    correctly. It's necessary to clean the cache lines that are at the
    start and end of the invalidate range, if the addresses are not aligned,
    to prevent corruption of other data sharing the same cache line.
    
    Signed-off-by: Rui Sousa <[EMAIL PROTECTED]>
    Acked-by: Catalin Marinas <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/cache-l2x0.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index b4e9b73..76b800a 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -57,7 +57,17 @@ static void l2x0_inv_range(unsigned long start, unsigned 
long end)
 {
        unsigned long addr;
 
-       start &= ~(CACHE_LINE_SIZE - 1);
+       if (start & (CACHE_LINE_SIZE - 1)) {
+               start &= ~(CACHE_LINE_SIZE - 1);
+               sync_writel(start, L2X0_CLEAN_INV_LINE_PA, 1);
+               start += CACHE_LINE_SIZE;
+       }
+
+       if (end & (CACHE_LINE_SIZE - 1)) {
+               end &= ~(CACHE_LINE_SIZE - 1);
+               sync_writel(end, L2X0_CLEAN_INV_LINE_PA, 1);
+       }
+
        for (addr = start; addr < end; addr += CACHE_LINE_SIZE)
                sync_writel(addr, L2X0_INV_LINE_PA, 1);
        cache_sync();
-
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