[RFC][PATCH 4/4] swsusp: Fix hibernation code ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rafael J. Wysocki <rjw@xxxxxxx>

Change the code ordering so that hibernation_ops->prepare() is called after
device_suspend().  This is needed so that we don't violate the ACPI
specification, which states that the _PTS and _GTS system-control methods,
executed from acpi_sleep_prepare(), ought to be called after devices have been
put in low power states.

Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
---
 kernel/power/disk.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6.22-rc1/kernel/power/disk.c
===================================================================
--- linux-2.6.22-rc1.orig/kernel/power/disk.c	2007-05-17 22:53:27.000000000 +0200
+++ linux-2.6.22-rc1/kernel/power/disk.c	2007-05-17 22:56:24.000000000 +0200
@@ -135,15 +135,15 @@ int hibernation_snapshot(int platform_mo
 	if (error)
 		goto Finish;
 
-	error = platform_prepare(platform_mode);
-	if (error)
-		goto Finish;
-
 	suspend_console();
 	error = device_suspend(PMSG_FREEZE);
 	if (error)
 		goto Resume_devices;
 
+	error = platform_prepare(platform_mode);
+	if (error)
+		goto Resume_devices;
+
 	error = disable_nonboot_cpus();
 	if (!error) {
 		if (hibernation_mode != HIBERNATION_TEST) {
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux