aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPavel Machek <pavel@suse.cz>2005-09-06 18:16:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:16 -0400
commitd7ae79c72d072e3208c18ff2dc402a69229b7b1b (patch)
treecdc92d7602d9b93637ff0444910ebe2d2f97ee68 /Documentation
parent48c8b1134249432318c8e5d19adc37c45242c4b1 (diff)
[PATCH] swsusp: update documentation
This updates documentation a bit (mostly removing obsolete stuff), and marks swsusp as no longer experimental in config. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/power/swsusp.txt101
-rw-r--r--Documentation/power/video.txt1
2 files changed, 57 insertions, 45 deletions
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index ddf907fbcc05..b0d50840788e 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -1,22 +1,20 @@
1From kernel/suspend.c: 1Some warnings, first.
2 2
3 * BIG FAT WARNING ********************************************************* 3 * BIG FAT WARNING *********************************************************
4 * 4 *
5 * If you have unsupported (*) devices using DMA...
6 * ...say goodbye to your data.
7 *
8 * If you touch anything on disk between suspend and resume... 5 * If you touch anything on disk between suspend and resume...
9 * ...kiss your data goodbye. 6 * ...kiss your data goodbye.
10 * 7 *
11 * If your disk driver does not support suspend... (IDE does) 8 * If you do resume from initrd after your filesystems are mounted...
12 * ...you'd better find out how to get along 9 * ...bye bye root partition.
13 * without your data. 10 * [this is actually same case as above]
14 *
15 * If you change kernel command line between suspend and resume...
16 * ...prepare for nasty fsck or worse.
17 * 11 *
18 * If you change your hardware while system is suspended... 12 * If you have unsupported (*) devices using DMA, you may have some
19 * ...well, it was not good idea. 13 * problems. If your disk driver does not support suspend... (IDE does),
14 * it may cause some problems, too. If you change kernel command line
15 * between suspend and resume, it may do something wrong. If you change
16 * your hardware while system is suspended... well, it was not good idea;
17 * but it will probably only crash.
20 * 18 *
21 * (*) suspend/resume support is needed to make it safe. 19 * (*) suspend/resume support is needed to make it safe.
22 20
@@ -30,6 +28,13 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state
30echo platform > /sys/power/disk; echo disk > /sys/power/state 28echo platform > /sys/power/disk; echo disk > /sys/power/state
31 29
32 30
31Encrypted suspend image:
32------------------------
33If you want to store your suspend image encrypted with a temporary
34key to prevent data gathering after resume you must compile
35crypto and the aes algorithm into the kernel - modules won't work
36as they cannot be loaded at resume time.
37
33 38
34Article about goals and implementation of Software Suspend for Linux 39Article about goals and implementation of Software Suspend for Linux
35~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -85,11 +90,6 @@ resume.
85You have your server on UPS. Power died, and UPS is indicating 30 90You have your server on UPS. Power died, and UPS is indicating 30
86seconds to failure. What do you do? Suspend to disk. 91seconds to failure. What do you do? Suspend to disk.
87 92
88Ethernet card in your server died. You want to replace it. Your
89server is not hotplug capable. What do you do? Suspend to disk,
90replace ethernet card, resume. If you are fast your users will not
91even see broken connections.
92
93 93
94Q: Maybe I'm missing something, but why don't the regular I/O paths work? 94Q: Maybe I'm missing something, but why don't the regular I/O paths work?
95 95
@@ -117,31 +117,6 @@ Q: Does linux support ACPI S4?
117 117
118A: Yes. That's what echo platform > /sys/power/disk does. 118A: Yes. That's what echo platform > /sys/power/disk does.
119 119
120Q: My machine doesn't work with ACPI. How can I use swsusp than ?
121
122A: Do a reboot() syscall with right parameters. Warning: glibc gets in
123its way, so check with strace:
124
125reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, 0xd000fce2)
126
127(Thanks to Peter Osterlund:)
128
129#include <unistd.h>
130#include <syscall.h>
131
132#define LINUX_REBOOT_MAGIC1 0xfee1dead
133#define LINUX_REBOOT_MAGIC2 672274793
134#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
135
136int main()
137{
138 syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
139 LINUX_REBOOT_CMD_SW_SUSPEND, 0);
140 return 0;
141}
142
143Also /sys/ interface should be still present.
144
145Q: What is 'suspend2'? 120Q: What is 'suspend2'?
146 121
147A: suspend2 is 'Software Suspend 2', a forked implementation of 122A: suspend2 is 'Software Suspend 2', a forked implementation of
@@ -312,9 +287,45 @@ system is shut down or suspended. Additionally use the encrypted
312suspend image to prevent sensitive data from being stolen after 287suspend image to prevent sensitive data from being stolen after
313resume. 288resume.
314 289
315Q: Why we cannot suspend to a swap file? 290Q: Why can't we suspend to a swap file?
316 291
317A: Because accessing swap file needs the filesystem mounted, and 292A: Because accessing swap file needs the filesystem mounted, and
318filesystem might do something wrong (like replaying the journal) 293filesystem might do something wrong (like replaying the journal)
319during mount. [Probably could be solved by modifying every filesystem 294during mount.
320to support some kind of "really read-only!" option. Patches welcome.] 295
296There are few ways to get that fixed:
297
2981) Probably could be solved by modifying every filesystem to support
299some kind of "really read-only!" option. Patches welcome.
300
3012) suspend2 gets around that by storing absolute positions in on-disk
302image (and blocksize), with resume parameter pointing directly to
303suspend header.
304
305Q: Is there a maximum system RAM size that is supported by swsusp?
306
307A: It should work okay with highmem.
308
309Q: Does swsusp (to disk) use only one swap partition or can it use
310multiple swap partitions (aggregate them into one logical space)?
311
312A: Only one swap partition, sorry.
313
314Q: If my application(s) causes lots of memory & swap space to be used
315(over half of the total system RAM), is it correct that it is likely
316to be useless to try to suspend to disk while that app is running?
317
318A: No, it should work okay, as long as your app does not mlock()
319it. Just prepare big enough swap partition.
320
321Q: What information is usefull for debugging suspend-to-disk problems?
322
323A: Well, last messages on the screen are always useful. If something
324is broken, it is usually some kernel driver, therefore trying with as
325little as possible modules loaded helps a lot. I also prefer people to
326suspend from console, preferably without X running. Booting with
327init=/bin/bash, then swapon and starting suspend sequence manually
328usually does the trick. Then it is good idea to try with latest
329vanilla kernel.
330
331
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index 1a44e8acb54c..526d6dd267ea 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -120,6 +120,7 @@ IBM ThinkPad T42p (2373-GTG) s3_bios (2)
120IBM TP X20 ??? (*) 120IBM TP X20 ??? (*)
121IBM TP X30 s3_bios (2) 121IBM TP X30 s3_bios (2)
122IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. 122IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight.
123IBM TP X32 none (1), but backlight is on and video is trashed after long suspend
123IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) 124IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
124Medion MD4220 ??? (*) 125Medion MD4220 ??? (*)
125Samsung P35 vbetool needed (6) 126Samsung P35 vbetool needed (6)