2 * kernel/power/hibernate.c - Hibernation (a.k.a suspend-to-disk) support.
4 * Copyright (c) 2003 Patrick Mochel
5 * Copyright (c) 2003 Open Source Development Lab
6 * Copyright (c) 2004 Pavel Machek <pavel@ucw.cz>
7 * Copyright (c) 2009 Rafael J. Wysocki, Novell Inc.
9 * This file is released under the GPLv2.
12 #include <linux/suspend.h>
13 #include <linux/syscalls.h>
14 #include <linux/reboot.h>
15 #include <linux/string.h>
16 #include <linux/device.h>
17 #include <linux/export.h>
18 #include <linux/kmod.h>
19 #include <linux/delay.h>
21 #include <linux/mount.h>
23 #include <linux/console.h>
24 #include <linux/cpu.h>
25 #include <linux/freezer.h>
26 #include <linux/gfp.h>
27 #include <linux/syscore_ops.h>
28 #include <scsi/scsi_scan.h>
33 static int nocompress
= 0;
34 static int noresume
= 0;
35 static char resume_file
[256] = CONFIG_PM_STD_PARTITION
;
36 dev_t swsusp_resume_device
;
37 sector_t swsusp_resume_block
;
38 int in_suspend __nosavedata
= 0;
48 __HIBERNATION_AFTER_LAST
50 #define HIBERNATION_MAX (__HIBERNATION_AFTER_LAST-1)
51 #define HIBERNATION_FIRST (HIBERNATION_INVALID + 1)
53 static int hibernation_mode
= HIBERNATION_SHUTDOWN
;
55 static const struct platform_hibernation_ops
*hibernation_ops
;
58 * hibernation_set_ops - Set the global hibernate operations.
59 * @ops: Hibernation operations to use in subsequent hibernation transitions.
61 void hibernation_set_ops(const struct platform_hibernation_ops
*ops
)
63 if (ops
&& !(ops
->begin
&& ops
->end
&& ops
->pre_snapshot
64 && ops
->prepare
&& ops
->finish
&& ops
->enter
&& ops
->pre_restore
65 && ops
->restore_cleanup
&& ops
->leave
)) {
69 mutex_lock(&pm_mutex
);
70 hibernation_ops
= ops
;
72 hibernation_mode
= HIBERNATION_PLATFORM
;
73 else if (hibernation_mode
== HIBERNATION_PLATFORM
)
74 hibernation_mode
= HIBERNATION_SHUTDOWN
;
76 mutex_unlock(&pm_mutex
);
79 static bool entering_platform_hibernation
;
81 bool system_entering_hibernation(void)
83 return entering_platform_hibernation
;
85 EXPORT_SYMBOL(system_entering_hibernation
);
87 #ifdef CONFIG_PM_DEBUG
88 static void hibernation_debug_sleep(void)
90 printk(KERN_INFO
"hibernation debug: Waiting for 5 seconds.\n");
94 static int hibernation_testmode(int mode
)
96 if (hibernation_mode
== mode
) {
97 hibernation_debug_sleep();
103 static int hibernation_test(int level
)
105 if (pm_test_level
== level
) {
106 hibernation_debug_sleep();
111 #else /* !CONFIG_PM_DEBUG */
112 static int hibernation_testmode(int mode
) { return 0; }
113 static int hibernation_test(int level
) { return 0; }
114 #endif /* !CONFIG_PM_DEBUG */
117 * platform_begin - Call platform to start hibernation.
118 * @platform_mode: Whether or not to use the platform driver.
120 static int platform_begin(int platform_mode
)
122 return (platform_mode
&& hibernation_ops
) ?
123 hibernation_ops
->begin() : 0;
127 * platform_end - Call platform to finish transition to the working state.
128 * @platform_mode: Whether or not to use the platform driver.
130 static void platform_end(int platform_mode
)
132 if (platform_mode
&& hibernation_ops
)
133 hibernation_ops
->end();
137 * platform_pre_snapshot - Call platform to prepare the machine for hibernation.
138 * @platform_mode: Whether or not to use the platform driver.
140 * Use the platform driver to prepare the system for creating a hibernate image,
141 * if so configured, and return an error code if that fails.
144 static int platform_pre_snapshot(int platform_mode
)
146 return (platform_mode
&& hibernation_ops
) ?
147 hibernation_ops
->pre_snapshot() : 0;
151 * platform_leave - Call platform to prepare a transition to the working state.
152 * @platform_mode: Whether or not to use the platform driver.
154 * Use the platform driver prepare to prepare the machine for switching to the
155 * normal mode of operation.
157 * This routine is called on one CPU with interrupts disabled.
159 static void platform_leave(int platform_mode
)
161 if (platform_mode
&& hibernation_ops
)
162 hibernation_ops
->leave();
166 * platform_finish - Call platform to switch the system to the working state.
167 * @platform_mode: Whether or not to use the platform driver.
169 * Use the platform driver to switch the machine to the normal mode of
172 * This routine must be called after platform_prepare().
174 static void platform_finish(int platform_mode
)
176 if (platform_mode
&& hibernation_ops
)
177 hibernation_ops
->finish();
181 * platform_pre_restore - Prepare for hibernate image restoration.
182 * @platform_mode: Whether or not to use the platform driver.
184 * Use the platform driver to prepare the system for resume from a hibernation
187 * If the restore fails after this function has been called,
188 * platform_restore_cleanup() must be called.
190 static int platform_pre_restore(int platform_mode
)
192 return (platform_mode
&& hibernation_ops
) ?
193 hibernation_ops
->pre_restore() : 0;
197 * platform_restore_cleanup - Switch to the working state after failing restore.
198 * @platform_mode: Whether or not to use the platform driver.
200 * Use the platform driver to switch the system to the normal mode of operation
201 * after a failing restore.
203 * If platform_pre_restore() has been called before the failing restore, this
204 * function must be called too, regardless of the result of
205 * platform_pre_restore().
207 static void platform_restore_cleanup(int platform_mode
)
209 if (platform_mode
&& hibernation_ops
)
210 hibernation_ops
->restore_cleanup();
214 * platform_recover - Recover from a failure to suspend devices.
215 * @platform_mode: Whether or not to use the platform driver.
217 static void platform_recover(int platform_mode
)
219 if (platform_mode
&& hibernation_ops
&& hibernation_ops
->recover
)
220 hibernation_ops
->recover();
224 * swsusp_show_speed - Print time elapsed between two events during hibernation.
225 * @start: Starting event.
226 * @stop: Final event.
227 * @nr_pages: Number of memory pages processed between @start and @stop.
228 * @msg: Additional diagnostic message to print.
230 void swsusp_show_speed(struct timeval
*start
, struct timeval
*stop
,
231 unsigned nr_pages
, char *msg
)
233 s64 elapsed_centisecs64
;
238 elapsed_centisecs64
= timeval_to_ns(stop
) - timeval_to_ns(start
);
239 do_div(elapsed_centisecs64
, NSEC_PER_SEC
/ 100);
240 centisecs
= elapsed_centisecs64
;
242 centisecs
= 1; /* avoid div-by-zero */
243 k
= nr_pages
* (PAGE_SIZE
/ 1024);
244 kps
= (k
* 100) / centisecs
;
245 printk(KERN_INFO
"PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n",
247 centisecs
/ 100, centisecs
% 100,
248 kps
/ 1000, (kps
% 1000) / 10);
252 * create_image - Create a hibernation image.
253 * @platform_mode: Whether or not to use the platform driver.
255 * Execute device drivers' .freeze_noirq() callbacks, create a hibernation image
256 * and execute the drivers' .thaw_noirq() callbacks.
258 * Control reappears in this routine after the subsequent restore.
260 static int create_image(int platform_mode
)
264 error
= dpm_suspend_noirq(PMSG_FREEZE
);
266 printk(KERN_ERR
"PM: Some devices failed to power down, "
267 "aborting hibernation\n");
271 error
= platform_pre_snapshot(platform_mode
);
272 if (error
|| hibernation_test(TEST_PLATFORM
))
273 goto Platform_finish
;
275 error
= disable_nonboot_cpus();
276 if (error
|| hibernation_test(TEST_CPUS
)
277 || hibernation_testmode(HIBERNATION_TEST
))
282 error
= syscore_suspend();
284 printk(KERN_ERR
"PM: Some system devices failed to power down, "
285 "aborting hibernation\n");
289 if (hibernation_test(TEST_CORE
) || pm_wakeup_pending())
293 save_processor_state();
294 error
= swsusp_arch_suspend();
296 printk(KERN_ERR
"PM: Error %d creating hibernation image\n",
298 /* Restore control flow magically appears here */
299 restore_processor_state();
301 events_check_enabled
= false;
302 platform_leave(platform_mode
);
312 enable_nonboot_cpus();
315 platform_finish(platform_mode
);
317 dpm_resume_noirq(in_suspend
?
318 (error
? PMSG_RECOVER
: PMSG_THAW
) : PMSG_RESTORE
);
324 * hibernation_snapshot - Quiesce devices and create a hibernation image.
325 * @platform_mode: If set, use platform driver to prepare for the transition.
327 * This routine must be called with pm_mutex held.
329 int hibernation_snapshot(int platform_mode
)
331 pm_message_t msg
= PMSG_RECOVER
;
334 error
= platform_begin(platform_mode
);
338 error
= dpm_prepare(PMSG_FREEZE
);
340 goto Complete_devices
;
342 /* Preallocate image memory before shutting down devices. */
343 error
= hibernate_preallocate_memory();
345 goto Complete_devices
;
348 pm_restrict_gfp_mask();
349 error
= dpm_suspend(PMSG_FREEZE
);
351 goto Recover_platform
;
353 if (hibernation_test(TEST_DEVICES
))
354 goto Recover_platform
;
356 error
= create_image(platform_mode
);
358 * Control returns here (1) after the image has been created or the
359 * image creation has failed and (2) after a successful restore.
363 /* We may need to release the preallocated image pages here. */
364 if (error
|| !in_suspend
)
367 msg
= in_suspend
? (error
? PMSG_RECOVER
: PMSG_THAW
) : PMSG_RESTORE
;
370 if (error
|| !in_suspend
)
371 pm_restore_gfp_mask();
379 platform_end(platform_mode
);
383 platform_recover(platform_mode
);
388 * resume_target_kernel - Restore system state from a hibernation image.
389 * @platform_mode: Whether or not to use the platform driver.
391 * Execute device drivers' .freeze_noirq() callbacks, restore the contents of
392 * highmem that have not been restored yet from the image and run the low-level
393 * code that will restore the remaining contents of memory and switch to the
394 * just restored target kernel.
396 static int resume_target_kernel(bool platform_mode
)
400 error
= dpm_suspend_noirq(PMSG_QUIESCE
);
402 printk(KERN_ERR
"PM: Some devices failed to power down, "
403 "aborting resume\n");
407 error
= platform_pre_restore(platform_mode
);
411 error
= disable_nonboot_cpus();
417 error
= syscore_suspend();
421 save_processor_state();
422 error
= restore_highmem();
424 error
= swsusp_arch_resume();
426 * The code below is only ever reached in case of a failure.
427 * Otherwise, execution continues at the place where
428 * swsusp_arch_suspend() was called.
432 * This call to restore_highmem() reverts the changes made by
438 * The only reason why swsusp_arch_resume() can fail is memory being
439 * very tight, so we have to free it as soon as we can to avoid
440 * subsequent failures.
443 restore_processor_state();
444 touch_softlockup_watchdog();
452 enable_nonboot_cpus();
455 platform_restore_cleanup(platform_mode
);
457 dpm_resume_noirq(PMSG_RECOVER
);
463 * hibernation_restore - Quiesce devices and restore from a hibernation image.
464 * @platform_mode: If set, use platform driver to prepare for the transition.
466 * This routine must be called with pm_mutex held. If it is successful, control
467 * reappears in the restored target kernel in hibernation_snaphot().
469 int hibernation_restore(int platform_mode
)
473 pm_prepare_console();
475 pm_restrict_gfp_mask();
476 error
= dpm_suspend_start(PMSG_QUIESCE
);
478 error
= resume_target_kernel(platform_mode
);
479 dpm_resume_end(PMSG_RECOVER
);
481 pm_restore_gfp_mask();
483 pm_restore_console();
488 * hibernation_platform_enter - Power off the system using the platform driver.
490 int hibernation_platform_enter(void)
494 if (!hibernation_ops
)
498 * We have cancelled the power transition by running
499 * hibernation_ops->finish() before saving the image, so we should let
500 * the firmware know that we're going to enter the sleep state after all
502 error
= hibernation_ops
->begin();
506 entering_platform_hibernation
= true;
508 error
= dpm_suspend_start(PMSG_HIBERNATE
);
510 if (hibernation_ops
->recover
)
511 hibernation_ops
->recover();
515 error
= dpm_suspend_noirq(PMSG_HIBERNATE
);
519 error
= hibernation_ops
->prepare();
521 goto Platform_finish
;
523 error
= disable_nonboot_cpus();
525 goto Platform_finish
;
529 if (pm_wakeup_pending()) {
534 hibernation_ops
->enter();
535 /* We should never get here */
541 enable_nonboot_cpus();
544 hibernation_ops
->finish();
546 dpm_resume_noirq(PMSG_RESTORE
);
549 entering_platform_hibernation
= false;
550 dpm_resume_end(PMSG_RESTORE
);
554 hibernation_ops
->end();
560 * power_down - Shut the machine down for hibernation.
562 * Use the platform driver, if configured, to put the system into the sleep
563 * state corresponding to hibernation, or try to power it off or reboot,
564 * depending on the value of hibernation_mode.
566 static void power_down(void)
568 switch (hibernation_mode
) {
569 case HIBERNATION_TEST
:
570 case HIBERNATION_TESTPROC
:
572 case HIBERNATION_REBOOT
:
573 kernel_restart(NULL
);
575 case HIBERNATION_PLATFORM
:
576 hibernation_platform_enter();
577 case HIBERNATION_SHUTDOWN
:
583 * Valid image is on the disk, if we continue we risk serious data
584 * corruption after resume.
586 printk(KERN_CRIT
"PM: Please power down manually\n");
591 * hibernate - Carry out system hibernation, including saving the image.
597 mutex_lock(&pm_mutex
);
598 /* The snapshot device should not be opened while we're running */
599 if (!atomic_add_unless(&snapshot_device_available
, -1, 0)) {
604 pm_prepare_console();
605 error
= pm_notifier_call_chain(PM_HIBERNATION_PREPARE
);
609 error
= usermodehelper_disable();
613 /* Allocate memory management structures */
614 error
= create_basic_memory_bitmaps();
618 printk(KERN_INFO
"PM: Syncing filesystems ... ");
622 error
= freeze_processes();
626 if (hibernation_test(TEST_FREEZER
))
629 if (hibernation_testmode(HIBERNATION_TESTPROC
))
632 error
= hibernation_snapshot(hibernation_mode
== HIBERNATION_PLATFORM
);
637 unsigned int flags
= 0;
639 if (hibernation_mode
== HIBERNATION_PLATFORM
)
640 flags
|= SF_PLATFORM_MODE
;
642 flags
|= SF_NOCOMPRESS_MODE
;
643 pr_debug("PM: writing image.\n");
644 error
= swsusp_write(flags
);
649 pm_restore_gfp_mask();
651 pr_debug("PM: Image restored successfully.\n");
657 free_basic_memory_bitmaps();
658 usermodehelper_enable();
660 pm_notifier_call_chain(PM_POST_HIBERNATION
);
661 pm_restore_console();
662 atomic_inc(&snapshot_device_available
);
664 mutex_unlock(&pm_mutex
);
670 * software_resume - Resume from a saved hibernation image.
672 * This routine is called as a late initcall, when all devices have been
673 * discovered and initialized already.
675 * The image reading code is called to see if there is a hibernation image
676 * available for reading. If that is the case, devices are quiesced and the
677 * contents of memory is restored from the saved image.
679 * If this is successful, control reappears in the restored target kernel in
680 * hibernation_snaphot() which returns to hibernate(). Otherwise, the routine
681 * attempts to recover gracefully and make the kernel return to the normal mode
684 static int software_resume(void)
690 * If the user said "noresume".. bail out early.
696 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
697 * is configured into the kernel. Since the regular hibernate
698 * trigger path is via sysfs which takes a buffer mutex before
699 * calling hibernate functions (which take pm_mutex) this can
700 * cause lockdep to complain about a possible ABBA deadlock
701 * which cannot happen since we're in the boot code here and
702 * sysfs can't be invoked yet. Therefore, we use a subclass
703 * here to avoid lockdep complaining.
705 mutex_lock_nested(&pm_mutex
, SINGLE_DEPTH_NESTING
);
707 if (swsusp_resume_device
)
710 if (!strlen(resume_file
)) {
715 pr_debug("PM: Checking hibernation image partition %s\n", resume_file
);
717 /* Check if the device is there */
718 swsusp_resume_device
= name_to_dev_t(resume_file
);
719 if (!swsusp_resume_device
) {
721 * Some device discovery might still be in progress; we need
722 * to wait for this to finish.
724 wait_for_device_probe();
726 * We can't depend on SCSI devices being available after loading
727 * one of their modules until scsi_complete_async_scans() is
728 * called and the resume device usually is a SCSI one.
730 scsi_complete_async_scans();
732 swsusp_resume_device
= name_to_dev_t(resume_file
);
733 if (!swsusp_resume_device
) {
740 pr_debug("PM: Hibernation image partition %d:%d present\n",
741 MAJOR(swsusp_resume_device
), MINOR(swsusp_resume_device
));
743 pr_debug("PM: Looking for hibernation image.\n");
744 error
= swsusp_check();
748 /* The snapshot device should not be opened while we're running */
749 if (!atomic_add_unless(&snapshot_device_available
, -1, 0)) {
751 swsusp_close(FMODE_READ
);
755 pm_prepare_console();
756 error
= pm_notifier_call_chain(PM_RESTORE_PREPARE
);
760 error
= usermodehelper_disable();
764 error
= create_basic_memory_bitmaps();
768 pr_debug("PM: Preparing processes for restore.\n");
769 error
= freeze_processes();
771 swsusp_close(FMODE_READ
);
775 pr_debug("PM: Loading hibernation image.\n");
777 error
= swsusp_read(&flags
);
778 swsusp_close(FMODE_READ
);
780 hibernation_restore(flags
& SF_PLATFORM_MODE
);
782 printk(KERN_ERR
"PM: Failed to load hibernation image, recovering.\n");
786 free_basic_memory_bitmaps();
787 usermodehelper_enable();
789 pm_notifier_call_chain(PM_POST_RESTORE
);
790 pm_restore_console();
791 atomic_inc(&snapshot_device_available
);
792 /* For success case, the suspend path will release the lock */
794 mutex_unlock(&pm_mutex
);
795 pr_debug("PM: Hibernation image not present or could not be loaded.\n");
798 swsusp_close(FMODE_READ
);
802 late_initcall(software_resume
);
805 static const char * const hibernation_modes
[] = {
806 [HIBERNATION_PLATFORM
] = "platform",
807 [HIBERNATION_SHUTDOWN
] = "shutdown",
808 [HIBERNATION_REBOOT
] = "reboot",
809 [HIBERNATION_TEST
] = "test",
810 [HIBERNATION_TESTPROC
] = "testproc",
814 * /sys/power/disk - Control hibernation mode.
816 * Hibernation can be handled in several ways. There are a few different ways
817 * to put the system into the sleep state: using the platform driver (e.g. ACPI
818 * or other hibernation_ops), powering it off or rebooting it (for testing
819 * mostly), or using one of the two available test modes.
821 * The sysfs file /sys/power/disk provides an interface for selecting the
822 * hibernation mode to use. Reading from this file causes the available modes
823 * to be printed. There are 5 modes that can be supported:
831 * If a platform hibernation driver is in use, 'platform' will be supported
832 * and will be used by default. Otherwise, 'shutdown' will be used by default.
833 * The selected option (i.e. the one corresponding to the current value of
834 * hibernation_mode) is enclosed by a square bracket.
836 * To select a given hibernation mode it is necessary to write the mode's
837 * string representation (as returned by reading from /sys/power/disk) back
838 * into /sys/power/disk.
841 static ssize_t
disk_show(struct kobject
*kobj
, struct kobj_attribute
*attr
,
847 for (i
= HIBERNATION_FIRST
; i
<= HIBERNATION_MAX
; i
++) {
848 if (!hibernation_modes
[i
])
851 case HIBERNATION_SHUTDOWN
:
852 case HIBERNATION_REBOOT
:
853 case HIBERNATION_TEST
:
854 case HIBERNATION_TESTPROC
:
856 case HIBERNATION_PLATFORM
:
859 /* not a valid mode, continue with loop */
862 if (i
== hibernation_mode
)
863 buf
+= sprintf(buf
, "[%s] ", hibernation_modes
[i
]);
865 buf
+= sprintf(buf
, "%s ", hibernation_modes
[i
]);
867 buf
+= sprintf(buf
, "\n");
871 static ssize_t
disk_store(struct kobject
*kobj
, struct kobj_attribute
*attr
,
872 const char *buf
, size_t n
)
878 int mode
= HIBERNATION_INVALID
;
880 p
= memchr(buf
, '\n', n
);
881 len
= p
? p
- buf
: n
;
883 mutex_lock(&pm_mutex
);
884 for (i
= HIBERNATION_FIRST
; i
<= HIBERNATION_MAX
; i
++) {
885 if (len
== strlen(hibernation_modes
[i
])
886 && !strncmp(buf
, hibernation_modes
[i
], len
)) {
891 if (mode
!= HIBERNATION_INVALID
) {
893 case HIBERNATION_SHUTDOWN
:
894 case HIBERNATION_REBOOT
:
895 case HIBERNATION_TEST
:
896 case HIBERNATION_TESTPROC
:
897 hibernation_mode
= mode
;
899 case HIBERNATION_PLATFORM
:
901 hibernation_mode
= mode
;
909 pr_debug("PM: Hibernation mode set to '%s'\n",
910 hibernation_modes
[mode
]);
911 mutex_unlock(&pm_mutex
);
912 return error
? error
: n
;
917 static ssize_t
resume_show(struct kobject
*kobj
, struct kobj_attribute
*attr
,
920 return sprintf(buf
,"%d:%d\n", MAJOR(swsusp_resume_device
),
921 MINOR(swsusp_resume_device
));
924 static ssize_t
resume_store(struct kobject
*kobj
, struct kobj_attribute
*attr
,
925 const char *buf
, size_t n
)
927 unsigned int maj
, min
;
931 if (sscanf(buf
, "%u:%u", &maj
, &min
) != 2)
934 res
= MKDEV(maj
,min
);
935 if (maj
!= MAJOR(res
) || min
!= MINOR(res
))
938 mutex_lock(&pm_mutex
);
939 swsusp_resume_device
= res
;
940 mutex_unlock(&pm_mutex
);
941 printk(KERN_INFO
"PM: Starting manual resume from disk\n");
951 static ssize_t
image_size_show(struct kobject
*kobj
, struct kobj_attribute
*attr
,
954 return sprintf(buf
, "%lu\n", image_size
);
957 static ssize_t
image_size_store(struct kobject
*kobj
, struct kobj_attribute
*attr
,
958 const char *buf
, size_t n
)
962 if (sscanf(buf
, "%lu", &size
) == 1) {
970 power_attr(image_size
);
972 static ssize_t
reserved_size_show(struct kobject
*kobj
,
973 struct kobj_attribute
*attr
, char *buf
)
975 return sprintf(buf
, "%lu\n", reserved_size
);
978 static ssize_t
reserved_size_store(struct kobject
*kobj
,
979 struct kobj_attribute
*attr
,
980 const char *buf
, size_t n
)
984 if (sscanf(buf
, "%lu", &size
) == 1) {
985 reserved_size
= size
;
992 power_attr(reserved_size
);
994 static struct attribute
* g
[] = {
997 &image_size_attr
.attr
,
998 &reserved_size_attr
.attr
,
1003 static struct attribute_group attr_group
= {
1008 static int __init
pm_disk_init(void)
1010 return sysfs_create_group(power_kobj
, &attr_group
);
1013 core_initcall(pm_disk_init
);
1016 static int __init
resume_setup(char *str
)
1021 strncpy( resume_file
, str
, 255 );
1025 static int __init
resume_offset_setup(char *str
)
1027 unsigned long long offset
;
1032 if (sscanf(str
, "%llu", &offset
) == 1)
1033 swsusp_resume_block
= offset
;
1038 static int __init
hibernate_setup(char *str
)
1040 if (!strncmp(str
, "noresume", 8))
1042 else if (!strncmp(str
, "nocompress", 10))
1047 static int __init
noresume_setup(char *str
)
1053 __setup("noresume", noresume_setup
);
1054 __setup("resume_offset=", resume_offset_setup
);
1055 __setup("resume=", resume_setup
);
1056 __setup("hibernate=", hibernate_setup
);