aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2013-08-14 10:25:14 -0400
committerJon Medhurst <tixy@linaro.org>2013-12-02 12:54:16 +0000
commit9902091e1e4aa3ff94e525c2a9ed3632698cd28f (patch)
tree76c8f57e48727eea9bd65af876a42e0c6f4f96ae /arch
parent4c35ee5ab39fb4ab30662edbfc7b6ea5c88943f2 (diff)
ARM: vexpress/MCPM: fix cache disable sequence when CONFIG_FRAME_POINTER=y
Commit fac2e57742d9aa3dbe41860280352efda9d5566e upstream If CONFIG_FRAME_POINTER=y we get the following error: arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down': arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here Let's fix that by explicitly preserving r11 on the stack and removing it from the clobber list. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-vexpress/dcscb.c16
-rw-r--r--arch/arm/mach-vexpress/tc2_pm.c16
2 files changed, 24 insertions, 8 deletions
diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c
index df593951cbf..19a7d08102b 100644
--- a/arch/arm/mach-vexpress/dcscb.c
+++ b/arch/arm/mach-vexpress/dcscb.c
@@ -145,8 +145,13 @@ static void dcscb_power_down(void)
* Let's do it in the safest possible way i.e. with
* no memory access within the following sequence
* including to the stack.
+ *
+ * Note: fp is preserved to the stack explicitly prior doing
+ * this since adding it to the clobber list is incompatible
+ * with having CONFIG_FRAME_POINTER=y.
*/
asm volatile(
+ "str fp, [sp, #-4]! \n\t"
"mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t"
"bic r0, r0, #"__stringify(CR_C)" \n\t"
"mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t"
@@ -157,9 +162,10 @@ static void dcscb_power_down(void)
"bic r0, r0, #(1 << 6) @ disable local coherency \n\t"
"mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t"
"isb \n\t"
- "dsb "
+ "dsb \n\t"
+ "ldr fp, [sp], #4"
: : : "r0","r1","r2","r3","r4","r5","r6","r7",
- "r9","r10","r11","lr","memory");
+ "r9","r10","lr","memory");
/*
* This is a harmless no-op. On platforms with a real
@@ -183,6 +189,7 @@ static void dcscb_power_down(void)
* Let's do it in the safest possible way as above.
*/
asm volatile(
+ "str fp, [sp, #-4]! \n\t"
"mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t"
"bic r0, r0, #"__stringify(CR_C)" \n\t"
"mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t"
@@ -193,9 +200,10 @@ static void dcscb_power_down(void)
"bic r0, r0, #(1 << 6) @ disable local coherency \n\t"
"mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t"
"isb \n\t"
- "dsb "
+ "dsb \n\t"
+ "ldr fp, [sp], #4"
: : : "r0","r1","r2","r3","r4","r5","r6","r7",
- "r9","r10","r11","lr","memory");
+ "r9","r10","lr","memory");
}
__mcpm_cpu_down(cpu, cluster);
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c
index b4b090ccc61..9221903af53 100644
--- a/arch/arm/mach-vexpress/tc2_pm.c
+++ b/arch/arm/mach-vexpress/tc2_pm.c
@@ -152,8 +152,13 @@ static void tc2_pm_down(u64 residency)
* Let's do it in the safest possible way i.e. with
* no memory access within the following sequence
* including the stack.
+ *
+ * Note: fp is preserved to the stack explicitly prior doing
+ * this since adding it to the clobber list is incompatible
+ * with having CONFIG_FRAME_POINTER=y.
*/
asm volatile(
+ "str fp, [sp, #-4]! \n\t"
"mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t"
"bic r0, r0, #"__stringify(CR_C)" \n\t"
"mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t"
@@ -164,9 +169,10 @@ static void tc2_pm_down(u64 residency)
"bic r0, r0, #(1 << 6) @ disable local coherency \n\t"
"mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t"
"isb \n\t"
- "dsb "
+ "dsb \n\t"
+ "ldr fp, [sp], #4"
: : : "r0","r1","r2","r3","r4","r5","r6","r7",
- "r9","r10","r11","lr","memory");
+ "r9","r10","lr","memory");
cci_disable_port_by_cpu(mpidr);
@@ -187,6 +193,7 @@ static void tc2_pm_down(u64 residency)
* Let's do it in the safest possible way as above.
*/
asm volatile(
+ "str fp, [sp, #-4]! \n\t"
"mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t"
"bic r0, r0, #"__stringify(CR_C)" \n\t"
"mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t"
@@ -197,9 +204,10 @@ static void tc2_pm_down(u64 residency)
"bic r0, r0, #(1 << 6) @ disable local coherency \n\t"
"mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t"
"isb \n\t"
- "dsb "
+ "dsb \n\t"
+ "ldr fp, [sp], #4"
: : : "r0","r1","r2","r3","r4","r5","r6","r7",
- "r9","r10","r11","lr","memory");
+ "r9","r10","lr","memory");
}
__mcpm_cpu_down(cpu, cluster);