diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2013-08-14 10:25:14 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-08-14 16:05:42 -0400 |
commit | fac2e57742d9aa3dbe41860280352efda9d5566e (patch) | |
tree | f57b0c2ff1ebf3a0d4b69aa2141d14c6fa22050a /arch/arm/mach-vexpress | |
parent | f2d6e550a23e6ea5aca70817ada87b78f2b8c6c1 (diff) |
ARM: vexpress/MCPM: fix cache disable sequence when CONFIG_FRAME_POINTER=y
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>
Diffstat (limited to 'arch/arm/mach-vexpress')
-rw-r--r-- | arch/arm/mach-vexpress/dcscb.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/tc2_pm.c | 16 |
2 files changed, 24 insertions, 8 deletions
diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c index 85fffa702f5b..3a6384c6c435 100644 --- a/arch/arm/mach-vexpress/dcscb.c +++ b/arch/arm/mach-vexpress/dcscb.c | |||
@@ -144,8 +144,13 @@ static void dcscb_power_down(void) | |||
144 | * Let's do it in the safest possible way i.e. with | 144 | * Let's do it in the safest possible way i.e. with |
145 | * no memory access within the following sequence | 145 | * no memory access within the following sequence |
146 | * including to the stack. | 146 | * including to the stack. |
147 | * | ||
148 | * Note: fp is preserved to the stack explicitly prior doing | ||
149 | * this since adding it to the clobber list is incompatible | ||
150 | * with having CONFIG_FRAME_POINTER=y. | ||
147 | */ | 151 | */ |
148 | asm volatile( | 152 | asm volatile( |
153 | "str fp, [sp, #-4]! \n\t" | ||
149 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" | 154 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" |
150 | "bic r0, r0, #"__stringify(CR_C)" \n\t" | 155 | "bic r0, r0, #"__stringify(CR_C)" \n\t" |
151 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" | 156 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" |
@@ -156,9 +161,10 @@ static void dcscb_power_down(void) | |||
156 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" | 161 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" |
157 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" | 162 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" |
158 | "isb \n\t" | 163 | "isb \n\t" |
159 | "dsb " | 164 | "dsb \n\t" |
165 | "ldr fp, [sp], #4" | ||
160 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", | 166 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", |
161 | "r9","r10","r11","lr","memory"); | 167 | "r9","r10","lr","memory"); |
162 | 168 | ||
163 | /* | 169 | /* |
164 | * This is a harmless no-op. On platforms with a real | 170 | * This is a harmless no-op. On platforms with a real |
@@ -182,6 +188,7 @@ static void dcscb_power_down(void) | |||
182 | * Let's do it in the safest possible way as above. | 188 | * Let's do it in the safest possible way as above. |
183 | */ | 189 | */ |
184 | asm volatile( | 190 | asm volatile( |
191 | "str fp, [sp, #-4]! \n\t" | ||
185 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" | 192 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" |
186 | "bic r0, r0, #"__stringify(CR_C)" \n\t" | 193 | "bic r0, r0, #"__stringify(CR_C)" \n\t" |
187 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" | 194 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" |
@@ -192,9 +199,10 @@ static void dcscb_power_down(void) | |||
192 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" | 199 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" |
193 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" | 200 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" |
194 | "isb \n\t" | 201 | "isb \n\t" |
195 | "dsb " | 202 | "dsb \n\t" |
203 | "ldr fp, [sp], #4" | ||
196 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", | 204 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", |
197 | "r9","r10","r11","lr","memory"); | 205 | "r9","r10","lr","memory"); |
198 | } | 206 | } |
199 | 207 | ||
200 | __mcpm_cpu_down(cpu, cluster); | 208 | __mcpm_cpu_down(cpu, cluster); |
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c index ddd97dd4e9b7..2b7c93a724ed 100644 --- a/arch/arm/mach-vexpress/tc2_pm.c +++ b/arch/arm/mach-vexpress/tc2_pm.c | |||
@@ -150,8 +150,13 @@ static void tc2_pm_down(u64 residency) | |||
150 | * Let's do it in the safest possible way i.e. with | 150 | * Let's do it in the safest possible way i.e. with |
151 | * no memory access within the following sequence | 151 | * no memory access within the following sequence |
152 | * including the stack. | 152 | * including the stack. |
153 | * | ||
154 | * Note: fp is preserved to the stack explicitly prior doing | ||
155 | * this since adding it to the clobber list is incompatible | ||
156 | * with having CONFIG_FRAME_POINTER=y. | ||
153 | */ | 157 | */ |
154 | asm volatile( | 158 | asm volatile( |
159 | "str fp, [sp, #-4]! \n\t" | ||
155 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" | 160 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" |
156 | "bic r0, r0, #"__stringify(CR_C)" \n\t" | 161 | "bic r0, r0, #"__stringify(CR_C)" \n\t" |
157 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" | 162 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" |
@@ -162,9 +167,10 @@ static void tc2_pm_down(u64 residency) | |||
162 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" | 167 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" |
163 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" | 168 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" |
164 | "isb \n\t" | 169 | "isb \n\t" |
165 | "dsb " | 170 | "dsb \n\t" |
171 | "ldr fp, [sp], #4" | ||
166 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", | 172 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", |
167 | "r9","r10","r11","lr","memory"); | 173 | "r9","r10","lr","memory"); |
168 | 174 | ||
169 | cci_disable_port_by_cpu(mpidr); | 175 | cci_disable_port_by_cpu(mpidr); |
170 | 176 | ||
@@ -185,6 +191,7 @@ static void tc2_pm_down(u64 residency) | |||
185 | * Let's do it in the safest possible way as above. | 191 | * Let's do it in the safest possible way as above. |
186 | */ | 192 | */ |
187 | asm volatile( | 193 | asm volatile( |
194 | "str fp, [sp, #-4]! \n\t" | ||
188 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" | 195 | "mrc p15, 0, r0, c1, c0, 0 @ get CR \n\t" |
189 | "bic r0, r0, #"__stringify(CR_C)" \n\t" | 196 | "bic r0, r0, #"__stringify(CR_C)" \n\t" |
190 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" | 197 | "mcr p15, 0, r0, c1, c0, 0 @ set CR \n\t" |
@@ -195,9 +202,10 @@ static void tc2_pm_down(u64 residency) | |||
195 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" | 202 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" |
196 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" | 203 | "mcr p15, 0, r0, c1, c0, 1 @ set AUXCR \n\t" |
197 | "isb \n\t" | 204 | "isb \n\t" |
198 | "dsb " | 205 | "dsb \n\t" |
206 | "ldr fp, [sp], #4" | ||
199 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", | 207 | : : : "r0","r1","r2","r3","r4","r5","r6","r7", |
200 | "r9","r10","r11","lr","memory"); | 208 | "r9","r10","lr","memory"); |
201 | } | 209 | } |
202 | 210 | ||
203 | __mcpm_cpu_down(cpu, cluster); | 211 | __mcpm_cpu_down(cpu, cluster); |