Skip to contentSkip to conversation

Hibernation: Resume consoles if hibernation_platform_enter fails

PATCH New Rafael J. Wysocki 1 participant 1 message Sep 15, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Hibernation: Resume consoles if hibernation_platform_enter fails

[This is a fix on top of hibernation-enter-platform-hibernation-state-in-a-consistent-way-rev-4.patch]
---
From: Rafael J. Wysocki <[email protected]>

If hibernation_platform_enter() fails, consoles should be resumed so that diagnostic information related to the failure is available to the user.

---
 kernel/power/disk.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/power/disk.c +3 -1
Index: linux-2.6.23-rc6/kernel/power/disk.c
===================================================================
@@ -293,7 +293,7 @@ int hibernation_platform_enter(void)
 	suspend_console();
 	error = device_suspend(PMSG_SUSPEND);
 	if (error)
-		return error;
+		goto Resume_console;
 
 	error = hibernation_ops->prepare();
 	if (error)
@@ -320,6 +320,8 @@ int hibernation_platform_enter(void)
 	hibernation_ops->finish();
  Resume_devices:
 	device_resume();
+ Resume_console:
+	resume_console();
 	return error;
 }