diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 08:41:41 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 13:07:53 -0400 |
commit | 816724e65c72a90a44fbad0ef0b59b186c85fa90 (patch) | |
tree | 421fa29aedff988e392f92780637553e275d37a0 /Documentation/power | |
parent | 70ac4385a13f78bc478f26d317511893741b05bd (diff) | |
parent | d384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts:
fs/nfs/inode.c
fs/super.c
Fix conflicts between patch 'NFS: Split fs/nfs/inode.c' and patch
'VFS: Permit filesystem to override root dentry on mount'
Diffstat (limited to 'Documentation/power')
-rw-r--r-- | Documentation/power/devices.txt | 90 | ||||
-rw-r--r-- | Documentation/power/swsusp.txt | 84 | ||||
-rw-r--r-- | Documentation/power/video.txt | 4 |
3 files changed, 70 insertions, 108 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index f987afe43e28..fba1e05c47c7 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -135,96 +135,6 @@ HW. | |||
135 | 135 | ||
136 | FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from | 136 | FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from |
137 | scratch. That probably means stop accepting upstream requests, the | 137 | scratch. That probably means stop accepting upstream requests, the |
138 | actual policy of what to do with them beeing specific to a given | ||
139 | driver. It's acceptable for a network driver to just drop packets | ||
140 | while a block driver is expected to block the queue so no request is | ||
141 | lost. (Use IDE as an example on how to do that). FREEZE requires no | ||
142 | power state change, and it's expected for drivers to be able to | ||
143 | quickly transition back to operating state. | ||
144 | |||
145 | SUSPEND -- like FREEZE, but also put hardware into low-power state. If | ||
146 | there's need to distinguish several levels of sleep, additional flag | ||
147 | is probably best way to do that. | ||
148 | |||
149 | Transitions are only from a resumed state to a suspended state, never | ||
150 | between 2 suspended states. (ON -> FREEZE or ON -> SUSPEND can happen, | ||
151 | FREEZE -> SUSPEND or SUSPEND -> FREEZE can not). | ||
152 | |||
153 | All events are: | ||
154 | |||
155 | [NOTE NOTE NOTE: If you are driver author, you should not care; you | ||
156 | should only look at event, and ignore flags.] | ||
157 | |||
158 | #Prepare for suspend -- userland is still running but we are going to | ||
159 | #enter suspend state. This gives drivers chance to load firmware from | ||
160 | #disk and store it in memory, or do other activities taht require | ||
161 | #operating userland, ability to kmalloc GFP_KERNEL, etc... All of these | ||
162 | #are forbiden once the suspend dance is started.. event = ON, flags = | ||
163 | #PREPARE_TO_SUSPEND | ||
164 | |||
165 | Apm standby -- prepare for APM event. Quiesce devices to make life | ||
166 | easier for APM BIOS. event = FREEZE, flags = APM_STANDBY | ||
167 | |||
168 | Apm suspend -- same as APM_STANDBY, but it we should probably avoid | ||
169 | spinning down disks. event = FREEZE, flags = APM_SUSPEND | ||
170 | |||
171 | System halt, reboot -- quiesce devices to make life easier for BIOS. event | ||
172 | = FREEZE, flags = SYSTEM_HALT or SYSTEM_REBOOT | ||
173 | |||
174 | System shutdown -- at least disks need to be spun down, or data may be | ||
175 | lost. Quiesce devices, just to make life easier for BIOS. event = | ||
176 | FREEZE, flags = SYSTEM_SHUTDOWN | ||
177 | |||
178 | Kexec -- turn off DMAs and put hardware into some state where new | ||
179 | kernel can take over. event = FREEZE, flags = KEXEC | ||
180 | |||
181 | Powerdown at end of swsusp -- very similar to SYSTEM_SHUTDOWN, except wake | ||
182 | may need to be enabled on some devices. This actually has at least 3 | ||
183 | subtypes, system can reboot, enter S4 and enter S5 at the end of | ||
184 | swsusp. event = FREEZE, flags = SWSUSP and one of SYSTEM_REBOOT, | ||
185 | SYSTEM_SHUTDOWN, SYSTEM_S4 | ||
186 | |||
187 | Suspend to ram -- put devices into low power state. event = SUSPEND, | ||
188 | flags = SUSPEND_TO_RAM | ||
189 | |||
190 | Freeze for swsusp snapshot -- stop DMA and interrupts. No need to put | ||
191 | devices into low power mode, but you must be able to reinitialize | ||
192 | device from scratch in resume method. This has two flavors, its done | ||
193 | once on suspending kernel, once on resuming kernel. event = FREEZE, | ||
194 | flags = DURING_SUSPEND or DURING_RESUME | ||
195 | |||
196 | Device detach requested from /sys -- deinitialize device; proably same as | ||
197 | SYSTEM_SHUTDOWN, I do not understand this one too much. probably event | ||
198 | = FREEZE, flags = DEV_DETACH. | ||
199 | |||
200 | #These are not really events sent: | ||
201 | # | ||
202 | #System fully on -- device is working normally; this is probably never | ||
203 | #passed to suspend() method... event = ON, flags = 0 | ||
204 | # | ||
205 | #Ready after resume -- userland is now running, again. Time to free any | ||
206 | #memory you ate during prepare to suspend... event = ON, flags = | ||
207 | #READY_AFTER_RESUME | ||
208 | # | ||
209 | |||
210 | |||
211 | pm_message_t meaning | ||
212 | |||
213 | pm_message_t has two fields. event ("major"), and flags. If driver | ||
214 | does not know event code, it aborts the request, returning error. Some | ||
215 | drivers may need to deal with special cases based on the actual type | ||
216 | of suspend operation being done at the system level. This is why | ||
217 | there are flags. | ||
218 | |||
219 | Event codes are: | ||
220 | |||
221 | ON -- no need to do anything except special cases like broken | ||
222 | HW. | ||
223 | |||
224 | # NOTIFICATION -- pretty much same as ON? | ||
225 | |||
226 | FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from | ||
227 | scratch. That probably means stop accepting upstream requests, the | ||
228 | actual policy of what to do with them being specific to a given | 138 | actual policy of what to do with them being specific to a given |
229 | driver. It's acceptable for a network driver to just drop packets | 139 | driver. It's acceptable for a network driver to just drop packets |
230 | while a block driver is expected to block the queue so no request is | 140 | while a block driver is expected to block the queue so no request is |
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index d7814a113ee1..823b2cf6e3dc 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -18,10 +18,11 @@ Some warnings, first. | |||
18 | * | 18 | * |
19 | * (*) suspend/resume support is needed to make it safe. | 19 | * (*) suspend/resume support is needed to make it safe. |
20 | * | 20 | * |
21 | * If you have any filesystems on USB devices mounted before suspend, | 21 | * If you have any filesystems on USB devices mounted before software suspend, |
22 | * they won't be accessible after resume and you may lose data, as though | 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 | 23 | * you have unplugged the USB devices with mounted filesystems on them; |
24 | * (see the FAQ below for details). | 24 | * see the FAQ below for details. (This is not true for more traditional |
25 | * power states like "standby", which normally don't turn USB off.) | ||
25 | 26 | ||
26 | You need to append resume=/dev/your_swap_partition to kernel command | 27 | You need to append resume=/dev/your_swap_partition to kernel command |
27 | line. Then you suspend by | 28 | line. Then you suspend by |
@@ -204,7 +205,7 @@ Q: There don't seem to be any generally useful behavioral | |||
204 | distinctions between SUSPEND and FREEZE. | 205 | distinctions between SUSPEND and FREEZE. |
205 | 206 | ||
206 | A: Doing SUSPEND when you are asked to do FREEZE is always correct, | 207 | A: Doing SUSPEND when you are asked to do FREEZE is always correct, |
207 | but it may be unneccessarily slow. If you want USB to stay simple, | 208 | but it may be unneccessarily slow. If you want your driver to stay simple, |
208 | slowness may not matter to you. It can always be fixed later. | 209 | slowness may not matter to you. It can always be fixed later. |
209 | 210 | ||
210 | For devices like disk it does matter, you do not want to spindown for | 211 | For devices like disk it does matter, you do not want to spindown for |
@@ -349,25 +350,72 @@ Q: How do I make suspend more verbose? | |||
349 | 350 | ||
350 | A: If you want to see any non-error kernel messages on the virtual | 351 | 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 | 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 | kernel console loglevel to at least 4 (KERN_WARNING), for example by |
353 | 354 | doing | |
354 | echo 5 > /proc/sys/kernel/printk | 355 | |
356 | # save the old loglevel | ||
357 | read LOGLEVEL DUMMY < /proc/sys/kernel/printk | ||
358 | # set the loglevel so we see the progress bar. | ||
359 | # if the level is higher than needed, we leave it alone. | ||
360 | if [ $LOGLEVEL -lt 5 ]; then | ||
361 | echo 5 > /proc/sys/kernel/printk | ||
362 | fi | ||
363 | |||
364 | IMG_SZ=0 | ||
365 | read IMG_SZ < /sys/power/image_size | ||
366 | echo -n disk > /sys/power/state | ||
367 | RET=$? | ||
368 | # | ||
369 | # the logic here is: | ||
370 | # if image_size > 0 (without kernel support, IMG_SZ will be zero), | ||
371 | # then try again with image_size set to zero. | ||
372 | if [ $RET -ne 0 -a $IMG_SZ -ne 0 ]; then # try again with minimal image size | ||
373 | echo 0 > /sys/power/image_size | ||
374 | echo -n disk > /sys/power/state | ||
375 | RET=$? | ||
376 | fi | ||
377 | |||
378 | # restore previous loglevel | ||
379 | echo $LOGLEVEL > /proc/sys/kernel/printk | ||
380 | exit $RET | ||
355 | 381 | ||
356 | Q: Is this true that if I have a mounted filesystem on a USB device and | 382 | 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 | 383 | I suspend to disk, I can lose data unless the filesystem has been mounted |
358 | with "sync"? | 384 | with "sync"? |
359 | 385 | ||
360 | A: That's right. It depends on your hardware, and it could be true even for | 386 | A: That's right ... if you disconnect that device, you may lose data. |
361 | suspend-to-RAM. In fact, even with "-o sync" you can lose data if your | 387 | In fact, even with "-o sync" you can lose data if your programs have |
362 | programs have information in buffers they haven't written out to disk. | 388 | information in buffers they haven't written out to a disk you disconnect, |
389 | or if you disconnect before the device finished saving data you wrote. | ||
363 | 390 | ||
364 | If you're lucky, your hardware will support low-power modes for USB | 391 | Software suspend normally powers down USB controllers, which is equivalent |
365 | controllers while the system is asleep. Lots of hardware doesn't, | 392 | to disconnecting all USB devices attached to your system. |
366 | however. Shutting off the power to a USB controller is equivalent to | ||
367 | unplugging all the attached devices. | ||
368 | 393 | ||
369 | Remember that it's always a bad idea to unplug a disk drive containing a | 394 | Your system might well support low-power modes for its USB controllers |
370 | mounted filesystem. With USB that's true even when your system is asleep! | 395 | while the system is asleep, maintaining the connection, using true sleep |
371 | The safest thing is to unmount all USB-based filesystems before suspending | 396 | modes like "suspend-to-RAM" or "standby". (Don't write "disk" to the |
372 | and remount them after resuming. | 397 | /sys/power/state file; write "standby" or "mem".) We've not seen any |
398 | hardware that can use these modes through software suspend, although in | ||
399 | theory some systems might support "platform" or "firmware" modes that | ||
400 | won't break the USB connections. | ||
373 | 401 | ||
402 | Remember that it's always a bad idea to unplug a disk drive containing a | ||
403 | mounted filesystem. That's true even when your system is asleep! The | ||
404 | safest thing is to unmount all filesystems on removable media (such USB, | ||
405 | Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays) | ||
406 | before suspending; then remount them after resuming. | ||
407 | |||
408 | Q: I upgraded the kernel from 2.6.15 to 2.6.16. Both kernels were | ||
409 | compiled with the similar configuration files. Anyway I found that | ||
410 | suspend to disk (and resume) is much slower on 2.6.16 compared to | ||
411 | 2.6.15. Any idea for why that might happen or how can I speed it up? | ||
412 | |||
413 | A: This is because the size of the suspend image is now greater than | ||
414 | for 2.6.15 (by saving more data we can get more responsive system | ||
415 | after resume). | ||
416 | |||
417 | There's the /sys/power/image_size knob that controls the size of the | ||
418 | image. If you set it to 0 (eg. by echo 0 > /sys/power/image_size as | ||
419 | root), the 2.6.15 behavior should be restored. If it is still too | ||
420 | slow, take a look at suspend.sf.net -- userland suspend is faster and | ||
421 | supports LZF compression to speed it up further. | ||
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt index 43a889f8f08d..d859faa3a463 100644 --- a/Documentation/power/video.txt +++ b/Documentation/power/video.txt | |||
@@ -90,6 +90,7 @@ Table of known working notebooks: | |||
90 | Model hack (or "how to do it") | 90 | Model hack (or "how to do it") |
91 | ------------------------------------------------------------------------------ | 91 | ------------------------------------------------------------------------------ |
92 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI | 92 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI |
93 | Acer TM 230 s3_bios (2) | ||
93 | Acer TM 242FX vbetool (6) | 94 | Acer TM 242FX vbetool (6) |
94 | Acer TM C110 video_post (8) | 95 | Acer TM C110 video_post (8) |
95 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8) | 96 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8) |
@@ -115,6 +116,7 @@ Dell D610 vga=normal and X (possibly vbestate (6) too, but not tested) | |||
115 | Dell Inspiron 4000 ??? (*) | 116 | Dell Inspiron 4000 ??? (*) |
116 | Dell Inspiron 500m ??? (*) | 117 | Dell Inspiron 500m ??? (*) |
117 | Dell Inspiron 510m ??? | 118 | Dell Inspiron 510m ??? |
119 | Dell Inspiron 5150 vbetool needed (6) | ||
118 | Dell Inspiron 600m ??? (*) | 120 | Dell Inspiron 600m ??? (*) |
119 | Dell Inspiron 8200 ??? (*) | 121 | Dell Inspiron 8200 ??? (*) |
120 | Dell Inspiron 8500 ??? (*) | 122 | Dell Inspiron 8500 ??? (*) |
@@ -125,6 +127,7 @@ HP NX7000 ??? (*) | |||
125 | HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X | 127 | HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X |
126 | HP Omnibook XE3 athlon version none (1) | 128 | HP Omnibook XE3 athlon version none (1) |
127 | HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV | 129 | HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV |
130 | HP Omnibook XE3L-GF vbetool (6) | ||
128 | HP Omnibook 5150 none (1), (S1 also works OK) | 131 | HP Omnibook 5150 none (1), (S1 also works OK) |
129 | IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work. | 132 | IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work. |
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 :-(] | 133 | 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 :-(] |
@@ -157,6 +160,7 @@ 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. | 160 | 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) | 161 | Sony Vaio vgn-FS115B s3_bios (2),s3_mode (4) |
159 | Toshiba Libretto L5 none (1) | 162 | Toshiba Libretto L5 none (1) |
163 | Toshiba Libretto 100CT/110CT vbetool (6) | ||
160 | Toshiba Portege 3020CT s3_mode (3) | 164 | Toshiba Portege 3020CT s3_mode (3) |
161 | Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK) | 165 | Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK) |
162 | Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK) | 166 | Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK) |