summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:24:43 -0600
committerQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:24:43 -0600
commitcfaf263c60e94bf4fe4005bb7281df144636ba42 (patch)
tree6006547c5bd81cc45882988997d2e857fc53d039 /arch
parent41286b07d6132a655777bdecc5ec80784ce80939 (diff)
Fix l2x0 cache invalidate handling of unaligned addresses
Patch to fix l2x0 cache invalidate handling of unaligned addresses. Applies to linux 2.6.22 for ARM-11 processors. Available from ARM Linux Patch System: http://www.arm.linux.org.uk/developer/patches/ ARM Patch ID 4568/1, Date: 14 Sep, 2007, Status: Applied. Notes: 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. Acked-by: Catalin Marinas http://www.bitshrine.org/gpp/linux-2.6.22-mx-Fix-l2x0-cache-invalidate-handling-of-unal.patch
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mm/cache-l2x0.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 08a36f1b35d2..24d791ebf9c7 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -51,7 +51,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();