Hi Gary,
Could you please try these two patches wrt [Bug 1283532] [NEW] NO_HZ fails for BE
I've tested it on my arndale board with my kernel that they fix cpu hotplug issue for arndale board. I do not have RT linux setup, so would appreciate help in testing.
Thanks, Victor
Victor Kamensky (2): ARM: EXYNOS: Fix hotplug wfi instruction in BE case ARM: EXYNOS: Fix hotplug BE image mon and hyp mode BE switch
arch/arm/mach-exynos/headsmp.S | 5 ++++- arch/arm/mach-exynos/hotplug.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
It is not clear why original code use numeric opcode for wfi instruction. Maybe toolchain used in that time did not understand this mnemonics.
Using direct opcode has the following problems: x) does not work in BE case; in BE8 case instructions are still little endian, so in BE image opcode should be byte swapped x) ARM opcode does not work in case CONFIG_THUMB2_KERNEL kernel even in LE case.
Solution is to replace numeric opcode with proper wfi asm mnemonics.
Signed-off-by: Victor Kamensky victor.kamensky@linaro.org --- arch/arm/mach-exynos/hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 4365ec8..f756a3e 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c @@ -101,7 +101,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) /* * here's the WFI */ - asm(".word 0xe320f003\n" + asm("wfi\n" : : : "memory", "cc");
In monitor and hypervisor mode first thing we need to do in case of BE image is to switch CPU into BE mode.
Signed-off-by: Victor Kamensky victor.kamensky@linaro.org --- arch/arm/mach-exynos/headsmp.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-exynos/headsmp.S b/arch/arm/mach-exynos/headsmp.S index 20c2f91..515a4f5 100644 --- a/arch/arm/mach-exynos/headsmp.S +++ b/arch/arm/mach-exynos/headsmp.S @@ -38,11 +38,14 @@ mon_vectors: W(b) . /* fiq */
/* Return directly back to the caller without leaving Hyp mode: */ -1: mrs lr, elr_hyp +1: +ARM_BE8(setend be) + mrs lr, elr_hyp mov pc, lr
/* In monitor mode, set up HVBAR and SCR then return to caller in NS-SVC. */ 2: +ARM_BE8(setend be) mrc p15, 0, r1, c1, c1, 0 @ SCR /* * Set SCR.NS=1(needed for setting HVBAR and also returning to NS state)
linaro-kernel@lists.linaro.org