mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
[ARM] pxa: skip registers saving/restoring if entering standby mode
registers are retained during standby mode, thus it's not necessary to save/restore and checksum Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
dd01b2fc79
commit
512f03fdae
1 changed files with 18 additions and 15 deletions
|
@ -38,34 +38,37 @@ int pxa_pm_enter(suspend_state_t state)
|
||||||
iwmmxt_task_disable(NULL);
|
iwmmxt_task_disable(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pxa_cpu_pm_fns->save(sleep_save);
|
/* skip registers saving for standby */
|
||||||
|
if (state != PM_SUSPEND_STANDBY) {
|
||||||
|
pxa_cpu_pm_fns->save(sleep_save);
|
||||||
|
/* before sleeping, calculate and save a checksum */
|
||||||
|
for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++)
|
||||||
|
sleep_save_checksum += sleep_save[i];
|
||||||
|
}
|
||||||
|
|
||||||
/* Clear sleep reset status */
|
/* Clear sleep reset status */
|
||||||
RCSR = RCSR_SMR;
|
RCSR = RCSR_SMR;
|
||||||
|
|
||||||
/* before sleeping, calculate and save a checksum */
|
|
||||||
for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++)
|
|
||||||
sleep_save_checksum += sleep_save[i];
|
|
||||||
|
|
||||||
/* *** go zzz *** */
|
/* *** go zzz *** */
|
||||||
pxa_cpu_pm_fns->enter(state);
|
pxa_cpu_pm_fns->enter(state);
|
||||||
cpu_init();
|
cpu_init();
|
||||||
|
|
||||||
/* after sleeping, validate the checksum */
|
if (state != PM_SUSPEND_STANDBY) {
|
||||||
for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++)
|
/* after sleeping, validate the checksum */
|
||||||
checksum += sleep_save[i];
|
for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++)
|
||||||
|
checksum += sleep_save[i];
|
||||||
|
|
||||||
/* if invalid, display message and wait for a hardware reset */
|
/* if invalid, display message and wait for a hardware reset */
|
||||||
if (checksum != sleep_save_checksum) {
|
if (checksum != sleep_save_checksum) {
|
||||||
#ifdef CONFIG_ARCH_LUBBOCK
|
#ifdef CONFIG_ARCH_LUBBOCK
|
||||||
LUB_HEXLED = 0xbadbadc5;
|
LUB_HEXLED = 0xbadbadc5;
|
||||||
#endif
|
#endif
|
||||||
while (1)
|
while (1)
|
||||||
pxa_cpu_pm_fns->enter(state);
|
pxa_cpu_pm_fns->enter(state);
|
||||||
|
}
|
||||||
|
pxa_cpu_pm_fns->restore(sleep_save);
|
||||||
}
|
}
|
||||||
|
|
||||||
pxa_cpu_pm_fns->restore(sleep_save);
|
|
||||||
|
|
||||||
pr_debug("*** made it back from resume\n");
|
pr_debug("*** made it back from resume\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue