ACPI: S4: Use "platform" rather than "shutdown" mode by default

It has been reported that on some systems the functionality after a resume
from disk is limited if the system is simply powered off during the suspend
instead of using the ACPI S4 suspend (aka platform mode).

Unfortunately the default is currently to power off the system during the
suspend so the users of these systems experience problems after the resume
if they don't switch to the platform mode explicitly. This patch makes swsusp
use the platform mode by default to avoid such situations.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Stefan Seyfried <seife@suse.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by Rafael J. Wysocki and committed by Len Brown 9185cfa9 8b0dc866

+6 -4
+5 -3
kernel/power/disk.c
··· 44 45 switch(mode) { 46 case PM_DISK_PLATFORM: 47 - kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); 48 - error = pm_ops->enter(PM_SUSPEND_DISK); 49 - break; 50 case PM_DISK_SHUTDOWN: 51 kernel_power_off(); 52 break;
··· 44 45 switch(mode) { 46 case PM_DISK_PLATFORM: 47 + if (pm_ops && pm_ops->enter) { 48 + kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); 49 + error = pm_ops->enter(PM_SUSPEND_DISK); 50 + break; 51 + } 52 case PM_DISK_SHUTDOWN: 53 kernel_power_off(); 54 break;
+1 -1
kernel/power/main.c
··· 27 DECLARE_MUTEX(pm_sem); 28 29 struct pm_ops *pm_ops; 30 - suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN; 31 32 /** 33 * pm_set_ops - Set the global power method table.
··· 27 DECLARE_MUTEX(pm_sem); 28 29 struct pm_ops *pm_ops; 30 + suspend_disk_method_t pm_disk_mode = PM_DISK_PLATFORM; 31 32 /** 33 * pm_set_ops - Set the global power method table.