diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-08-27 17:39:09 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-09-20 18:33:38 -0400 |
commit | de8e71ca4f2e17329f6718ae88d5c8336cb249ee (patch) | |
tree | cec0f26c5f4c9efd601edc1ac716aed168f65e1f /arch/arm/mm/proc-v7.S | |
parent | e8ce0eb5e2254b85415e4b58e73f24a5d13846a1 (diff) |
ARM: pm: only use preallocated page table during resume
Only use the preallocated page table during the resume, not while
suspending. This avoids the overhead of having to switch unnecessarily
to the resume page table in the suspend path.
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r-- | arch/arm/mm/proc-v7.S | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 21d6910d2208..b56004f90d93 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -217,22 +217,21 @@ ENDPROC(cpu_v7_set_pte_ext) | |||
217 | 217 | ||
218 | /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ | 218 | /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ |
219 | .globl cpu_v7_suspend_size | 219 | .globl cpu_v7_suspend_size |
220 | .equ cpu_v7_suspend_size, 4 * 9 | 220 | .equ cpu_v7_suspend_size, 4 * 8 |
221 | #ifdef CONFIG_PM_SLEEP | 221 | #ifdef CONFIG_PM_SLEEP |
222 | ENTRY(cpu_v7_do_suspend) | 222 | ENTRY(cpu_v7_do_suspend) |
223 | stmfd sp!, {r4 - r11, lr} | 223 | stmfd sp!, {r4 - r10, lr} |
224 | mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID | 224 | mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID |
225 | mrc p15, 0, r5, c13, c0, 1 @ Context ID | 225 | mrc p15, 0, r5, c13, c0, 1 @ Context ID |
226 | mrc p15, 0, r6, c13, c0, 3 @ User r/o thread ID | 226 | mrc p15, 0, r6, c13, c0, 3 @ User r/o thread ID |
227 | stmia r0!, {r4 - r6} | 227 | stmia r0!, {r4 - r6} |
228 | mrc p15, 0, r6, c3, c0, 0 @ Domain ID | 228 | mrc p15, 0, r6, c3, c0, 0 @ Domain ID |
229 | mrc p15, 0, r7, c2, c0, 0 @ TTB 0 | 229 | mrc p15, 0, r7, c2, c0, 1 @ TTB 1 |
230 | mrc p15, 0, r8, c2, c0, 1 @ TTB 1 | 230 | mrc p15, 0, r8, c1, c0, 0 @ Control register |
231 | mrc p15, 0, r9, c1, c0, 0 @ Control register | 231 | mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register |
232 | mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register | 232 | mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control |
233 | mrc p15, 0, r11, c1, c0, 2 @ Co-processor access control | 233 | stmia r0, {r6 - r10} |
234 | stmia r0, {r6 - r11} | 234 | ldmfd sp!, {r4 - r10, pc} |
235 | ldmfd sp!, {r4 - r11, pc} | ||
236 | ENDPROC(cpu_v7_do_suspend) | 235 | ENDPROC(cpu_v7_do_suspend) |
237 | 236 | ||
238 | ENTRY(cpu_v7_do_resume) | 237 | ENTRY(cpu_v7_do_resume) |
@@ -243,22 +242,24 @@ ENTRY(cpu_v7_do_resume) | |||
243 | mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID | 242 | mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID |
244 | mcr p15, 0, r5, c13, c0, 1 @ Context ID | 243 | mcr p15, 0, r5, c13, c0, 1 @ Context ID |
245 | mcr p15, 0, r6, c13, c0, 3 @ User r/o thread ID | 244 | mcr p15, 0, r6, c13, c0, 3 @ User r/o thread ID |
246 | ldmia r0, {r6 - r11} | 245 | ldmia r0, {r6 - r10} |
247 | mcr p15, 0, r6, c3, c0, 0 @ Domain ID | 246 | mcr p15, 0, r6, c3, c0, 0 @ Domain ID |
248 | mcr p15, 0, r7, c2, c0, 0 @ TTB 0 | 247 | ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP) |
249 | mcr p15, 0, r8, c2, c0, 1 @ TTB 1 | 248 | ALT_UP(orr r1, r1, #TTB_FLAGS_UP) |
249 | mcr p15, 0, r1, c2, c0, 0 @ TTB 0 | ||
250 | mcr p15, 0, r7, c2, c0, 1 @ TTB 1 | ||
250 | mcr p15, 0, ip, c2, c0, 2 @ TTB control register | 251 | mcr p15, 0, ip, c2, c0, 2 @ TTB control register |
251 | mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register | 252 | mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register |
252 | teq r4, r10 @ Is it already set? | 253 | teq r4, r9 @ Is it already set? |
253 | mcrne p15, 0, r10, c1, c0, 1 @ No, so write it | 254 | mcrne p15, 0, r9, c1, c0, 1 @ No, so write it |
254 | mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control | 255 | mcr p15, 0, r10, c1, c0, 2 @ Co-processor access control |
255 | ldr r4, =PRRR @ PRRR | 256 | ldr r4, =PRRR @ PRRR |
256 | ldr r5, =NMRR @ NMRR | 257 | ldr r5, =NMRR @ NMRR |
257 | mcr p15, 0, r4, c10, c2, 0 @ write PRRR | 258 | mcr p15, 0, r4, c10, c2, 0 @ write PRRR |
258 | mcr p15, 0, r5, c10, c2, 1 @ write NMRR | 259 | mcr p15, 0, r5, c10, c2, 1 @ write NMRR |
259 | isb | 260 | isb |
260 | dsb | 261 | dsb |
261 | mov r0, r9 @ control register | 262 | mov r0, r8 @ control register |
262 | b cpu_resume_mmu | 263 | b cpu_resume_mmu |
263 | ENDPROC(cpu_v7_do_resume) | 264 | ENDPROC(cpu_v7_do_resume) |
264 | #endif | 265 | #endif |