Commit 36d1f8a3 authored by Patrick Mochel's avatar Patrick Mochel

[swsusp] Restore software_suspend() call.

- Allows 'backdoor' interface to swsusp, as requested by Pavel. 

- Simply a wrapper to pm_suspend(), though guaranteeing that swsusp is used,
  and system is shutdown (and put into low-power state).

- Call in sys_reboot() changed back to call to software_suspend().
parent 774bc11f
...@@ -53,6 +53,7 @@ extern suspend_pagedir_t *pagedir_nosave __nosavedata; ...@@ -53,6 +53,7 @@ extern suspend_pagedir_t *pagedir_nosave __nosavedata;
extern void do_suspend_lowlevel(int resume); extern void do_suspend_lowlevel(int resume);
extern void do_suspend_lowlevel_s4bios(int resume); extern void do_suspend_lowlevel_s4bios(int resume);
extern int software_suspend(void);
#else /* CONFIG_SOFTWARE_SUSPEND */ #else /* CONFIG_SOFTWARE_SUSPEND */
static inline int software_suspend(void) static inline int software_suspend(void)
{ {
......
...@@ -948,6 +948,17 @@ int swsusp_free(void) ...@@ -948,6 +948,17 @@ int swsusp_free(void)
return 0; return 0;
} }
int software_suspend(void)
{
struct pm_ops swsusp_ops = {
.pm_disk_mode = PM_DISK_SHUTDOWN,
};
pm_set_ops(&swsusp_ops);
return pm_suspend(PM_SUSPEND_DISK);
}
static int __init resume_setup(char *str) static int __init resume_setup(char *str)
{ {
if (strlen(str)) if (strlen(str))
......
...@@ -456,7 +456,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user ...@@ -456,7 +456,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
#ifdef CONFIG_SOFTWARE_SUSPEND #ifdef CONFIG_SOFTWARE_SUSPEND
case LINUX_REBOOT_CMD_SW_SUSPEND: case LINUX_REBOOT_CMD_SW_SUSPEND:
if (!pm_suspend(PM_SUSPEND_DISK)) if (!software_suspend())
break; break;
do_exit(0); do_exit(0);
break; break;
......
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