X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Documentation%2Fpower%2Fswsusp.txt;h=d7814a113ee1752a7c91c54ae6841407baa73370;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=5cdab4c55e69bdcaab01455d7b3173499cf864d3;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index 5cdab4c55..d7814a113 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt @@ -1,43 +1,48 @@ -From kernel/suspend.c: +Some warnings, first. * BIG FAT WARNING ********************************************************* * - * If you have unsupported (*) devices using DMA... - * ...say goodbye to your data. - * * If you touch anything on disk between suspend and resume... * ...kiss your data goodbye. * - * If your disk driver does not support suspend... (IDE does) - * ...you'd better find out how to get along - * without your data. + * If you do resume from initrd after your filesystems are mounted... + * ...bye bye root partition. + * [this is actually same case as above] + * + * If you have unsupported (*) devices using DMA, you may have some + * problems. If your disk driver does not support suspend... (IDE does), + * it may cause some problems, too. If you change kernel command line + * between suspend and resume, it may do something wrong. If you change + * your hardware while system is suspended... well, it was not good idea; + * but it will probably only crash. * - * If you change kernel command line between suspend and resume... - * ...prepare for nasty fsck or worse. + * (*) suspend/resume support is needed to make it safe. * - * (*) pm interface support is needed to make it safe. + * If you have any filesystems on USB devices mounted before suspend, + * they won't be accessible after resume and you may lose data, as though + * you have unplugged the USB devices with mounted filesystems on them + * (see the FAQ below for details). You need to append resume=/dev/your_swap_partition to kernel command -line. Then you suspend by echo 4 > /proc/acpi/sleep. +line. Then you suspend by + +echo shutdown > /sys/power/disk; echo disk > /sys/power/state -Pavel's unreliable guide to swsusp mess -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +. If you feel ACPI works pretty well on your system, you might try -There are currently two versions of swap suspend in the kernel, the old -"Pavel's" version in kernel/power/swsusp.c and the new "Patrick's" -version in kernel/power/pmdisk.c. They provide the same functionality; -the old version looks ugly but was tested, while the new version looks -nicer but did not receive so much testing. echo 4 > /proc/acpi/sleep -calls the old version, echo disk > /sys/power/state calls the new one. +echo platform > /sys/power/disk; echo disk > /sys/power/state -[In the future, when the new version is stable enough, two things can -happen: +. If you have SATA disks, you'll need recent kernels with SATA suspend +support. For suspend and resume to work, make sure your disk drivers +are built into kernel -- not modules. [There's way to make +suspend/resume with modular disk drivers, see FAQ, but you probably +should not do that.] -* the new version is moved into swsusp.c, and swsusp is renamed to swap - suspend (Pavel prefers this) +If you want to limit the suspend image size to N bytes, do -* pmdisk is kept as is and swsusp.c is removed from the kernel] +echo N > /sys/power/image_size +before suspend (it is limited to 500 MB by default). Article about goals and implementation of Software Suspend for Linux @@ -52,51 +57,24 @@ saves the state of the machine to a filesystem or to a partition and switches to standby mode. Later resuming the machine the saved state is loaded back to ram and the machine can continue its work. It has two real benefits. First we save ourselves the time machine goes down and later boots up, energy costs -real high when running from batteries. The other gain is that we don't have to +are real high when running from batteries. The other gain is that we don't have to interrupt our programs so processes that are calculating something for a long time shouldn't need to be written interruptible. -Using the code - -You have two ways to use this code. The first one is is with a patched -SysVinit (my patch is against 2.76 and available at my home page). You -might call 'swsusp' or 'shutdown -z