[PATCH] ARM: start: Fix code reordering problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds a barrier after setup_c(). This is necessary because otherwise
some global variable assignments may be reordered by the compiler to be
executed before setup_c which cannot work.
This was observed when doing other unrelated changes to the start function,
it seems in current mainline state the compiler does not actually reorder
the code.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 arch/arm/cpu/start.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 304ed0c..91fd9b9 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -61,6 +61,8 @@ static noinline __noreturn void __start(unsigned long membase,
 
 	setup_c();
 
+	barrier();
+
 	pr_debug("memory at 0x%08lx, size 0x%08lx\n", membase, memsize);
 
 	barebox_boarddata = boarddata;
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux