Commit 2ca6f62f authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM: Fix error code paths executed after failing syscore_suspend()

If syscore_suspend() fails in suspend_enter(), create_image() or
resume_target_kernel(), it is necessary to call sysdev_resume(),
because sysdev_suspend() has been called already and succeeded
and we are going to abort the transition.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a1b49cb7
...@@ -273,8 +273,11 @@ static int create_image(int platform_mode) ...@@ -273,8 +273,11 @@ static int create_image(int platform_mode)
local_irq_disable(); local_irq_disable();
error = sysdev_suspend(PMSG_FREEZE); error = sysdev_suspend(PMSG_FREEZE);
if (!error) if (!error) {
error = syscore_suspend(); error = syscore_suspend();
if (error)
sysdev_resume();
}
if (error) { if (error) {
printk(KERN_ERR "PM: Some system devices failed to power down, " printk(KERN_ERR "PM: Some system devices failed to power down, "
"aborting hibernation\n"); "aborting hibernation\n");
...@@ -407,8 +410,11 @@ static int resume_target_kernel(bool platform_mode) ...@@ -407,8 +410,11 @@ static int resume_target_kernel(bool platform_mode)
local_irq_disable(); local_irq_disable();
error = sysdev_suspend(PMSG_QUIESCE); error = sysdev_suspend(PMSG_QUIESCE);
if (!error) if (!error) {
error = syscore_suspend(); error = syscore_suspend();
if (error)
sysdev_resume();
}
if (error) if (error)
goto Enable_irqs; goto Enable_irqs;
......
...@@ -164,8 +164,11 @@ static int suspend_enter(suspend_state_t state) ...@@ -164,8 +164,11 @@ static int suspend_enter(suspend_state_t state)
BUG_ON(!irqs_disabled()); BUG_ON(!irqs_disabled());
error = sysdev_suspend(PMSG_SUSPEND); error = sysdev_suspend(PMSG_SUSPEND);
if (!error) if (!error) {
error = syscore_suspend(); error = syscore_suspend();
if (error)
sysdev_resume();
}
if (!error) { if (!error) {
if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) {
error = suspend_ops->enter(state); error = suspend_ops->enter(state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment