diff options
-rw-r--r-- | Documentation/power/swsusp.txt | 51 | ||||
-rw-r--r-- | Documentation/power/video.txt | 74 | ||||
-rw-r--r-- | kernel/power/process.c | 2 |
3 files changed, 78 insertions, 49 deletions
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index b28b7f04abb8..d7814a113ee1 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -17,6 +17,11 @@ Some warnings, first. | |||
17 | * but it will probably only crash. | 17 | * but it will probably only crash. |
18 | * | 18 | * |
19 | * (*) suspend/resume support is needed to make it safe. | 19 | * (*) suspend/resume support is needed to make it safe. |
20 | * | ||
21 | * If you have any filesystems on USB devices mounted before suspend, | ||
22 | * they won't be accessible after resume and you may lose data, as though | ||
23 | * you have unplugged the USB devices with mounted filesystems on them | ||
24 | * (see the FAQ below for details). | ||
20 | 25 | ||
21 | You need to append resume=/dev/your_swap_partition to kernel command | 26 | You need to append resume=/dev/your_swap_partition to kernel command |
22 | line. Then you suspend by | 27 | line. Then you suspend by |
@@ -27,19 +32,18 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state | |||
27 | 32 | ||
28 | echo platform > /sys/power/disk; echo disk > /sys/power/state | 33 | echo platform > /sys/power/disk; echo disk > /sys/power/state |
29 | 34 | ||
35 | . If you have SATA disks, you'll need recent kernels with SATA suspend | ||
36 | support. For suspend and resume to work, make sure your disk drivers | ||
37 | are built into kernel -- not modules. [There's way to make | ||
38 | suspend/resume with modular disk drivers, see FAQ, but you probably | ||
39 | should not do that.] | ||
40 | |||
30 | If you want to limit the suspend image size to N bytes, do | 41 | If you want to limit the suspend image size to N bytes, do |
31 | 42 | ||
32 | echo N > /sys/power/image_size | 43 | echo N > /sys/power/image_size |
33 | 44 | ||
34 | before suspend (it is limited to 500 MB by default). | 45 | before suspend (it is limited to 500 MB by default). |
35 | 46 | ||
36 | Encrypted suspend image: | ||
37 | ------------------------ | ||
38 | If you want to store your suspend image encrypted with a temporary | ||
39 | key to prevent data gathering after resume you must compile | ||
40 | crypto and the aes algorithm into the kernel - modules won't work | ||
41 | as they cannot be loaded at resume time. | ||
42 | |||
43 | 47 | ||
44 | Article about goals and implementation of Software Suspend for Linux | 48 | Article about goals and implementation of Software Suspend for Linux |
45 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 49 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -333,4 +337,37 @@ init=/bin/bash, then swapon and starting suspend sequence manually | |||
333 | usually does the trick. Then it is good idea to try with latest | 337 | usually does the trick. Then it is good idea to try with latest |
334 | vanilla kernel. | 338 | vanilla kernel. |
335 | 339 | ||
340 | Q: How can distributions ship a swsusp-supporting kernel with modular | ||
341 | disk drivers (especially SATA)? | ||
342 | |||
343 | A: Well, it can be done, load the drivers, then do echo into | ||
344 | /sys/power/disk/resume file from initrd. Be sure not to mount | ||
345 | anything, not even read-only mount, or you are going to lose your | ||
346 | data. | ||
347 | |||
348 | Q: How do I make suspend more verbose? | ||
349 | |||
350 | A: If you want to see any non-error kernel messages on the virtual | ||
351 | terminal the kernel switches to during suspend, you have to set the | ||
352 | kernel console loglevel to at least 5, for example by doing | ||
353 | |||
354 | echo 5 > /proc/sys/kernel/printk | ||
355 | |||
356 | Q: Is this true that if I have a mounted filesystem on a USB device and | ||
357 | I suspend to disk, I can lose data unless the filesystem has been mounted | ||
358 | with "sync"? | ||
359 | |||
360 | A: That's right. It depends on your hardware, and it could be true even for | ||
361 | suspend-to-RAM. In fact, even with "-o sync" you can lose data if your | ||
362 | programs have information in buffers they haven't written out to disk. | ||
363 | |||
364 | If you're lucky, your hardware will support low-power modes for USB | ||
365 | controllers while the system is asleep. Lots of hardware doesn't, | ||
366 | however. Shutting off the power to a USB controller is equivalent to | ||
367 | unplugging all the attached devices. | ||
368 | |||
369 | Remember that it's always a bad idea to unplug a disk drive containing a | ||
370 | mounted filesystem. With USB that's true even when your system is asleep! | ||
371 | The safest thing is to unmount all USB-based filesystems before suspending | ||
372 | and remount them after resuming. | ||
336 | 373 | ||
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt index 912bed87c758..d18a57d1a531 100644 --- a/Documentation/power/video.txt +++ b/Documentation/power/video.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | Video issues with S3 resume | 2 | Video issues with S3 resume |
3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4 | 2003-2005, Pavel Machek | 4 | 2003-2006, Pavel Machek |
5 | 5 | ||
6 | During S3 resume, hardware needs to be reinitialized. For most | 6 | During S3 resume, hardware needs to be reinitialized. For most |
7 | devices, this is easy, and kernel driver knows how to do | 7 | devices, this is easy, and kernel driver knows how to do |
@@ -15,6 +15,27 @@ run normally so video card is normally initialized. It should not be | |||
15 | problem for S1 standby, because hardware should retain its state over | 15 | problem for S1 standby, because hardware should retain its state over |
16 | that. | 16 | that. |
17 | 17 | ||
18 | We either have to run video BIOS during early resume, or interpret it | ||
19 | using vbetool later, or maybe nothing is neccessary on particular | ||
20 | system because video state is preserved. Unfortunately different | ||
21 | methods work on different systems, and no known method suits all of | ||
22 | them. | ||
23 | |||
24 | Userland application called s2ram has been developed; it contains long | ||
25 | whitelist of systems, and automatically selects working method for a | ||
26 | given system. It can be downloaded from CVS at | ||
27 | www.sf.net/projects/suspend . If you get a system that is not in the | ||
28 | whitelist, please try to find a working solution, and submit whitelist | ||
29 | entry so that work does not need to be repeated. | ||
30 | |||
31 | Currently, VBE_SAVE method (6 below) works on most | ||
32 | systems. Unfortunately, vbetool only runs after userland is resumed, | ||
33 | so it makes debugging of early resume problems | ||
34 | hard/impossible. Methods that do not rely on userland are preferable. | ||
35 | |||
36 | Details | ||
37 | ~~~~~~~ | ||
38 | |||
18 | There are a few types of systems where video works after S3 resume: | 39 | There are a few types of systems where video works after S3 resume: |
19 | 40 | ||
20 | (1) systems where video state is preserved over S3. | 41 | (1) systems where video state is preserved over S3. |
@@ -104,6 +125,7 @@ HP NX7000 ??? (*) | |||
104 | HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X | 125 | HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X |
105 | HP Omnibook XE3 athlon version none (1) | 126 | HP Omnibook XE3 athlon version none (1) |
106 | HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV | 127 | HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV |
128 | HP Omnibook 5150 none (1), (S1 also works OK) | ||
107 | IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work. | 129 | IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work. |
108 | IBM TP A31 / Type 2652-M5G s3_mode (3) [works ok with BIOS 1.04 2002-08-23, but not at all with BIOS 1.11 2004-11-05 :-(] | 130 | IBM TP A31 / Type 2652-M5G s3_mode (3) [works ok with BIOS 1.04 2002-08-23, but not at all with BIOS 1.11 2004-11-05 :-(] |
109 | IBM TP R32 / Type 2658-MMG none (1) | 131 | IBM TP R32 / Type 2658-MMG none (1) |
@@ -120,18 +142,24 @@ IBM ThinkPad T42p (2373-GTG) s3_bios (2) | |||
120 | IBM TP X20 ??? (*) | 142 | IBM TP X20 ??? (*) |
121 | IBM TP X30 s3_bios (2) | 143 | IBM TP X30 s3_bios (2) |
122 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. | 144 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. |
123 | IBM TP X32 none (1), but backlight is on and video is trashed after long suspend | 145 | IBM TP X32 none (1), but backlight is on and video is trashed after long suspend. s3_bios,s3_mode (4) works too. Perhaps that gets better results? |
124 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) | 146 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) |
147 | IBM TP 600e none(1), but a switch to console and back to X is needed | ||
125 | Medion MD4220 ??? (*) | 148 | Medion MD4220 ??? (*) |
126 | Samsung P35 vbetool needed (6) | 149 | Samsung P35 vbetool needed (6) |
127 | Sharp PC-AR10 (ATI rage) none (1) | 150 | Sharp PC-AR10 (ATI rage) none (1), backlight does not switch off |
128 | Sony Vaio PCG-C1VRX/K s3_bios (2) | 151 | Sony Vaio PCG-C1VRX/K s3_bios (2) |
129 | Sony Vaio PCG-F403 ??? (*) | 152 | Sony Vaio PCG-F403 ??? (*) |
153 | Sony Vaio PCG-GRT995MP none (1), works with 'nv' X driver | ||
154 | Sony Vaio PCG-GR7/K none (1), but needs radeonfb, use radeontool (http://fdd.com/software/radeon/) to turn off backlight. | ||
130 | Sony Vaio PCG-N505SN ??? (*) | 155 | Sony Vaio PCG-N505SN ??? (*) |
131 | Sony Vaio vgn-s260 X or boot-radeon can init it (5) | 156 | Sony Vaio vgn-s260 X or boot-radeon can init it (5) |
157 | Sony Vaio vgn-S580BH vga=normal, but suspend from X. Console will be blank unless you return to X. | ||
158 | Sony Vaio vgn-FS115B s3_bios (2),s3_mode (4) | ||
132 | Toshiba Libretto L5 none (1) | 159 | Toshiba Libretto L5 none (1) |
133 | Toshiba Satellite 4030CDT s3_mode (3) | 160 | Toshiba Portege 3020CT s3_mode (3) |
134 | Toshiba Satellite 4080XCDT s3_mode (3) | 161 | Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK) |
162 | Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK) | ||
135 | Toshiba Satellite 4090XCDT ??? (*) | 163 | Toshiba Satellite 4090XCDT ??? (*) |
136 | Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) | 164 | Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) |
137 | Toshiba M30 (2) xor X with nvidia driver using internal AGP | 165 | Toshiba M30 (2) xor X with nvidia driver using internal AGP |
@@ -151,39 +179,3 @@ Asus A7V8X nVidia RIVA TNT2 model 64 s3_bios,s3_mode (4) | |||
151 | (***) To be tested with a newer kernel. | 179 | (***) To be tested with a newer kernel. |
152 | 180 | ||
153 | (****) Not with SMP kernel, UP only. | 181 | (****) Not with SMP kernel, UP only. |
154 | |||
155 | VBEtool details | ||
156 | ~~~~~~~~~~~~~~~ | ||
157 | (with thanks to Carl-Daniel Hailfinger) | ||
158 | |||
159 | First, boot into X and run the following script ONCE: | ||
160 | #!/bin/bash | ||
161 | statedir=/root/s3/state | ||
162 | mkdir -p $statedir | ||
163 | chvt 2 | ||
164 | sleep 1 | ||
165 | vbetool vbestate save >$statedir/vbe | ||
166 | |||
167 | |||
168 | To suspend and resume properly, call the following script as root: | ||
169 | #!/bin/bash | ||
170 | statedir=/root/s3/state | ||
171 | curcons=`fgconsole` | ||
172 | fuser /dev/tty$curcons 2>/dev/null|xargs ps -o comm= -p|grep -q X && chvt 2 | ||
173 | cat /dev/vcsa >$statedir/vcsa | ||
174 | sync | ||
175 | echo 3 >/proc/acpi/sleep | ||
176 | sync | ||
177 | vbetool post | ||
178 | vbetool vbestate restore <$statedir/vbe | ||
179 | cat $statedir/vcsa >/dev/vcsa | ||
180 | rckbd restart | ||
181 | chvt $[curcons%6+1] | ||
182 | chvt $curcons | ||
183 | |||
184 | |||
185 | Unless you change your graphics card or other hardware configuration, | ||
186 | the state once saved will be OK for every resume afterwards. | ||
187 | NOTE: The "rckbd restart" command may be different for your | ||
188 | distribution. Simply replace it with the command you would use to | ||
189 | set the fonts on screen. | ||
diff --git a/kernel/power/process.c b/kernel/power/process.c index 28de118f7a0b..02a1b3a9fa90 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -83,7 +83,7 @@ int freeze_processes(void) | |||
83 | yield(); /* Yield is okay here */ | 83 | yield(); /* Yield is okay here */ |
84 | if (todo && time_after(jiffies, start_time + TIMEOUT)) { | 84 | if (todo && time_after(jiffies, start_time + TIMEOUT)) { |
85 | printk( "\n" ); | 85 | printk( "\n" ); |
86 | printk(KERN_ERR " stopping tasks failed (%d tasks remaining)\n", todo ); | 86 | printk(KERN_ERR " stopping tasks timed out (%d tasks remaining)\n", todo ); |
87 | break; | 87 | break; |
88 | } | 88 | } |
89 | } while(todo); | 89 | } while(todo); |