aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c/pm.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2009-03-10 07:48:07 -0400
committerBen Dooks <ben-linux@fluff.org>2009-03-10 07:48:07 -0400
commitfff94cd9f5527bbba13aa5ea5719d16531ca8e65 (patch)
treebddf3ef686410872d8da882688229688710d574b /arch/arm/plat-s3c/pm.c
parentaa8aba6944203a17a7e941b42d8415153c649660 (diff)
[ARM] S3C: Tidy sleep code path to fix call flow
As noted by Russell King, the sleep code path is not elegant and makes use of leaving items on the stack between calls. Change the code that does the following: if (s3c_cpu_save(regs_save) == 0) { flush_cache_all(); S3C_PMDBG("preparing to sleep\n"); pm_cpu_sleep(); } to simply call s3c_cpu_save, and let that do the necessary calls to quiesce and sleep the system. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/pm.c')
-rw-r--r--arch/arm/plat-s3c/pm.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
index a0ca18a75b0e..061182ca66e3 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-s3c/pm.c
@@ -229,7 +229,7 @@ void (*pm_cpu_sleep)(void);
229 229
230static int s3c_pm_enter(suspend_state_t state) 230static int s3c_pm_enter(suspend_state_t state)
231{ 231{
232 unsigned long regs_save[16]; 232 static unsigned long regs_save[16];
233 233
234 /* ensure the debug is initialised (if enabled) */ 234 /* ensure the debug is initialised (if enabled) */
235 235
@@ -289,15 +289,11 @@ static int s3c_pm_enter(suspend_state_t state)
289 289
290 s3c_pm_arch_stop_clocks(); 290 s3c_pm_arch_stop_clocks();
291 291
292 /* s3c2410_cpu_save will also act as our return point from when 292 /* s3c_cpu_save will also act as our return point from when
293 * we resume as it saves its own register state, so use the return 293 * we resume as it saves its own register state and restores it
294 * code to differentiate return from save and return from sleep */ 294 * during the resume. */
295 295
296 if (s3c_cpu_save(regs_save) == 0) { 296 s3c_cpu_save(regs_save);
297 flush_cache_all();
298 S3C_PMDBG("preparing to sleep\n");
299 pm_cpu_sleep();
300 }
301 297
302 /* restore the cpu state using the kernel's cpu init code. */ 298 /* restore the cpu state using the kernel's cpu init code. */
303 299
@@ -325,6 +321,12 @@ static int s3c_pm_enter(suspend_state_t state)
325 return 0; 321 return 0;
326} 322}
327 323
324/* callback from assembly code */
325void s3c_pm_cb_flushcache(void)
326{
327 flush_cache_all();
328}
329
328static int s3c_pm_prepare(void) 330static int s3c_pm_prepare(void)
329{ 331{
330 /* prepare check area if configured */ 332 /* prepare check area if configured */