diff options
| -rw-r--r-- | arch/arm/mach-pxa/pm.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index a941c71c7d06..039194cbe477 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c | |||
| @@ -38,34 +38,37 @@ int pxa_pm_enter(suspend_state_t state) | |||
| 38 | iwmmxt_task_disable(NULL); | 38 | iwmmxt_task_disable(NULL); |
| 39 | #endif | 39 | #endif |
| 40 | 40 | ||
| 41 | pxa_cpu_pm_fns->save(sleep_save); | 41 | /* skip registers saving for standby */ |
| 42 | if (state != PM_SUSPEND_STANDBY) { | ||
| 43 | pxa_cpu_pm_fns->save(sleep_save); | ||
| 44 | /* before sleeping, calculate and save a checksum */ | ||
| 45 | for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++) | ||
| 46 | sleep_save_checksum += sleep_save[i]; | ||
| 47 | } | ||
| 42 | 48 | ||
| 43 | /* Clear sleep reset status */ | 49 | /* Clear sleep reset status */ |
| 44 | RCSR = RCSR_SMR; | 50 | RCSR = RCSR_SMR; |
| 45 | 51 | ||
| 46 | /* before sleeping, calculate and save a checksum */ | ||
| 47 | for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++) | ||
| 48 | sleep_save_checksum += sleep_save[i]; | ||
| 49 | |||
| 50 | /* *** go zzz *** */ | 52 | /* *** go zzz *** */ |
| 51 | pxa_cpu_pm_fns->enter(state); | 53 | pxa_cpu_pm_fns->enter(state); |
| 52 | cpu_init(); | 54 | cpu_init(); |
| 53 | 55 | ||
| 54 | /* after sleeping, validate the checksum */ | 56 | if (state != PM_SUSPEND_STANDBY) { |
| 55 | for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++) | 57 | /* after sleeping, validate the checksum */ |
| 56 | checksum += sleep_save[i]; | 58 | for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++) |
| 59 | checksum += sleep_save[i]; | ||
| 57 | 60 | ||
| 58 | /* if invalid, display message and wait for a hardware reset */ | 61 | /* if invalid, display message and wait for a hardware reset */ |
| 59 | if (checksum != sleep_save_checksum) { | 62 | if (checksum != sleep_save_checksum) { |
| 60 | #ifdef CONFIG_ARCH_LUBBOCK | 63 | #ifdef CONFIG_ARCH_LUBBOCK |
| 61 | LUB_HEXLED = 0xbadbadc5; | 64 | LUB_HEXLED = 0xbadbadc5; |
| 62 | #endif | 65 | #endif |
| 63 | while (1) | 66 | while (1) |
| 64 | pxa_cpu_pm_fns->enter(state); | 67 | pxa_cpu_pm_fns->enter(state); |
| 68 | } | ||
| 69 | pxa_cpu_pm_fns->restore(sleep_save); | ||
| 65 | } | 70 | } |
| 66 | 71 | ||
| 67 | pxa_cpu_pm_fns->restore(sleep_save); | ||
| 68 | |||
| 69 | pr_debug("*** made it back from resume\n"); | 72 | pr_debug("*** made it back from resume\n"); |
| 70 | 73 | ||
| 71 | return 0; | 74 | return 0; |
