[RFC PATCH] ARM: Flush L2 cache on soft_restart

Taras Kondratiuk taras.kondratiuk at linaro.org
Wed Oct 2 07:34:16 EDT 2013


Kexec disables L2 cache before jumping to reboot code,
but it doesn't flush it. So often just copied reboot code
gets corrupted, because part of it is stored in L2 cache
and have not reached memory.

Flushing cache prevents this corruption.

I'm facing this issue on Pandaboard ES, but it looks like
similar issue is observed on TC2 board [1].

[1] http://www.spinics.net/lists/arm-kernel/msg264339.html

Signed-off-by: Taras Kondratiuk <taras.kondratiuk at linaro.org>
---
 arch/arm/kernel/process.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 94f6b05..e359b62 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -103,9 +103,11 @@ void soft_restart(unsigned long addr)
 	local_irq_disable();
 	local_fiq_disable();
 
-	/* Disable the L2 if we're the last man standing. */
-	if (num_online_cpus() == 1)
+	/* Flush and disable the L2 if we're the last man standing. */
+	if (num_online_cpus() == 1) {
+		outer_flush_all();
 		outer_disable();
+	}
 
 	/* Change to the new stack and continue with the reset. */
 	call_with_stack(__soft_restart, (void *)addr, (void *)stack);
-- 
1.7.9.5




More information about the linux-arm-kernel mailing list