Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM / Suspend: Fix bug in suspend statistics update PM / Hibernate: Fix the early termination of test modes PM / shmobile: Fix build of sh7372_pm_init() for CONFIG_PM unset PM Sleep: Do not extend wakeup paths to devices with ignore_children set PM / driver core: disable device's runtime PM during shutdown PM / devfreq: correct Kconfig dependency PM / devfreq: fix use after free in devfreq_remove_device PM / shmobile: Avoid restoring the INTCS state during initialization PM / devfreq: Remove compiler error after irq.h update PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request() PM / Clocks: Only disable enabled clocks in pm_clk_suspend() ARM: mach-shmobile: sh7372 A3SP no_suspend_console fix PM / shmobile: Don't skip debugging output in pd_power_up()
This commit is contained in:
@ -55,6 +55,8 @@ enum {
|
||||
|
||||
static int hibernation_mode = HIBERNATION_SHUTDOWN;
|
||||
|
||||
static bool freezer_test_done;
|
||||
|
||||
static const struct platform_hibernation_ops *hibernation_ops;
|
||||
|
||||
/**
|
||||
@ -347,6 +349,17 @@ int hibernation_snapshot(int platform_mode)
|
||||
if (error)
|
||||
goto Close;
|
||||
|
||||
if (hibernation_test(TEST_FREEZER) ||
|
||||
hibernation_testmode(HIBERNATION_TESTPROC)) {
|
||||
|
||||
/*
|
||||
* Indicate to the caller that we are returning due to a
|
||||
* successful freezer test.
|
||||
*/
|
||||
freezer_test_done = true;
|
||||
goto Close;
|
||||
}
|
||||
|
||||
error = dpm_prepare(PMSG_FREEZE);
|
||||
if (error)
|
||||
goto Complete_devices;
|
||||
@ -641,15 +654,13 @@ int hibernate(void)
|
||||
if (error)
|
||||
goto Finish;
|
||||
|
||||
if (hibernation_test(TEST_FREEZER))
|
||||
goto Thaw;
|
||||
|
||||
if (hibernation_testmode(HIBERNATION_TESTPROC))
|
||||
goto Thaw;
|
||||
|
||||
error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
|
||||
if (error)
|
||||
goto Thaw;
|
||||
if (freezer_test_done) {
|
||||
freezer_test_done = false;
|
||||
goto Thaw;
|
||||
}
|
||||
|
||||
if (in_suspend) {
|
||||
unsigned int flags = 0;
|
||||
|
@ -290,13 +290,14 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
|
||||
break;
|
||||
}
|
||||
if (state < PM_SUSPEND_MAX && *s)
|
||||
if (state < PM_SUSPEND_MAX && *s) {
|
||||
error = enter_state(state);
|
||||
if (error) {
|
||||
suspend_stats.fail++;
|
||||
dpm_save_failed_errno(error);
|
||||
} else
|
||||
suspend_stats.success++;
|
||||
}
|
||||
#endif
|
||||
|
||||
Exit:
|
||||
|
Reference in New Issue
Block a user