aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/sleep.S
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-08-27 17:39:09 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-20 18:33:38 -0400
commitde8e71ca4f2e17329f6718ae88d5c8336cb249ee (patch)
treecec0f26c5f4c9efd601edc1ac716aed168f65e1f /arch/arm/kernel/sleep.S
parente8ce0eb5e2254b85415e4b58e73f24a5d13846a1 (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/kernel/sleep.S')
-rw-r--r--arch/arm/kernel/sleep.S19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 8cf13de1e368..25d42dfb0a92 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -9,12 +9,14 @@
9 9
10/* 10/*
11 * Save CPU state for a suspend 11 * Save CPU state for a suspend
12 * r0 = phys addr of temporary page tables
12 * r1 = v:p offset 13 * r1 = v:p offset
13 * r2 = suspend function arg0 14 * r2 = suspend function arg0
14 * r3 = suspend function 15 * r3 = suspend function
15 */ 16 */
16ENTRY(__cpu_suspend) 17ENTRY(__cpu_suspend)
17 stmfd sp!, {r4 - r11, lr} 18 stmfd sp!, {r4 - r11, lr}
19 mov r4, r0
18#ifdef MULTI_CPU 20#ifdef MULTI_CPU
19 ldr r10, =processor 21 ldr r10, =processor
20 ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state 22 ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
@@ -27,7 +29,7 @@ ENTRY(__cpu_suspend)
27 sub sp, sp, r5 @ allocate CPU state on stack 29 sub sp, sp, r5 @ allocate CPU state on stack
28 mov r0, sp @ save pointer to CPU save block 30 mov r0, sp @ save pointer to CPU save block
29 add ip, ip, r1 @ convert resume fn to phys 31 add ip, ip, r1 @ convert resume fn to phys
30 stmfd sp!, {r6, ip} @ save virt SP, phys resume fn 32 stmfd sp!, {r4, r6, ip} @ save phys pgd, virt SP, phys resume fn
31 ldr r5, =sleep_save_sp 33 ldr r5, =sleep_save_sp
32 add r6, sp, r1 @ convert SP to phys 34 add r6, sp, r1 @ convert SP to phys
33 stmfd sp!, {r2, r3} @ save suspend func arg and pointer 35 stmfd sp!, {r2, r3} @ save suspend func arg and pointer
@@ -60,7 +62,7 @@ ENDPROC(__cpu_suspend)
60 .ltorg 62 .ltorg
61 63
62cpu_suspend_abort: 64cpu_suspend_abort:
63 ldmia sp!, {r2 - r3} @ pop virt SP, phys resume fn 65 ldmia sp!, {r1 - r3} @ pop phys pgd, virt SP, phys resume fn
64 teq r0, #0 66 teq r0, #0
65 moveq r0, #1 @ force non-zero value 67 moveq r0, #1 @ force non-zero value
66 mov sp, r2 68 mov sp, r2
@@ -69,9 +71,6 @@ ENDPROC(cpu_suspend_abort)
69 71
70/* 72/*
71 * r0 = control register value 73 * r0 = control register value
72 * r1 = v:p offset (preserved by cpu_do_resume)
73 * r2 = phys page table base
74 * r3 = L1 section flags
75 */ 74 */
76ENTRY(cpu_resume_mmu) 75ENTRY(cpu_resume_mmu)
77 ldr r3, =cpu_resume_after_mmu 76 ldr r3, =cpu_resume_after_mmu
@@ -112,11 +111,11 @@ ENTRY(cpu_resume)
112 ldr r0, sleep_save_sp @ stack phys addr 111 ldr r0, sleep_save_sp @ stack phys addr
113#endif 112#endif
114 setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set SVC, irqs off 113 setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set SVC, irqs off
115 @ load stack, resume fn 114 @ load phys pgd, stack, resume fn
116 ARM( ldmia r0!, {sp, pc} ) 115 ARM( ldmia r0!, {r1, sp, pc} )
117THUMB( ldmia r0!, {r2, r3} ) 116THUMB( ldmia r0!, {r1, r2, r3} )
118THUMB( mov sp, r2 ) 117THUMB( mov sp, r2 )
119THUMB( bx r3 ) 118THUMB( bx r3 )
120ENDPROC(cpu_resume) 119ENDPROC(cpu_resume)
121 120
122sleep_save_sp: 121sleep_save_sp: