diff options
author | Ben Dooks <ben-linux@fluff.org> | 2009-03-10 11:48:07 +0000 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-03-10 11:48:07 +0000 |
commit | fff94cd9f5527bbba13aa5ea5719d16531ca8e65 (patch) | |
tree | bddf3ef686410872d8da882688229688710d574b /arch/arm/plat-s3c/pm.c | |
parent | aa8aba6944203a17a7e941b42d8415153c649660 (diff) | |
download | kernel_samsung_tuna-fff94cd9f5527bbba13aa5ea5719d16531ca8e65.zip kernel_samsung_tuna-fff94cd9f5527bbba13aa5ea5719d16531ca8e65.tar.gz kernel_samsung_tuna-fff94cd9f5527bbba13aa5ea5719d16531ca8e65.tar.bz2 |
[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.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c index a0ca18a..061182c 100644 --- a/arch/arm/plat-s3c/pm.c +++ b/arch/arm/plat-s3c/pm.c @@ -229,7 +229,7 @@ void (*pm_cpu_sleep)(void); static int s3c_pm_enter(suspend_state_t state) { - unsigned long regs_save[16]; + static unsigned long regs_save[16]; /* ensure the debug is initialised (if enabled) */ @@ -289,15 +289,11 @@ static int s3c_pm_enter(suspend_state_t state) s3c_pm_arch_stop_clocks(); - /* s3c2410_cpu_save will also act as our return point from when - * we resume as it saves its own register state, so use the return - * code to differentiate return from save and return from sleep */ + /* s3c_cpu_save will also act as our return point from when + * we resume as it saves its own register state and restores it + * during the resume. */ - if (s3c_cpu_save(regs_save) == 0) { - flush_cache_all(); - S3C_PMDBG("preparing to sleep\n"); - pm_cpu_sleep(); - } + s3c_cpu_save(regs_save); /* restore the cpu state using the kernel's cpu init code. */ @@ -325,6 +321,12 @@ static int s3c_pm_enter(suspend_state_t state) return 0; } +/* callback from assembly code */ +void s3c_pm_cb_flushcache(void) +{ + flush_cache_all(); +} + static int s3c_pm_prepare(void) { /* prepare check area if configured */ |