diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/power/swsusp.txt | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index d7814a113ee1..516c5019013b 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 |
@@ -357,17 +358,25 @@ 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 | I suspend to disk, I can lose data unless the filesystem has been mounted |
358 | with "sync"? | 359 | with "sync"? |
359 | 360 | ||
360 | A: That's right. It depends on your hardware, and it could be true even for | 361 | 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 | 362 | 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. | 363 | information in buffers they haven't written out to a disk you disconnect, |
364 | or if you disconnect before the device finished saving data you wrote. | ||
363 | 365 | ||
364 | If you're lucky, your hardware will support low-power modes for USB | 366 | Software suspend normally powers down USB controllers, which is equivalent |
365 | controllers while the system is asleep. Lots of hardware doesn't, | 367 | to disconnecting all USB devices attached to your system. |
366 | however. Shutting off the power to a USB controller is equivalent to | 368 | |
367 | unplugging all the attached devices. | 369 | Your system might well support low-power modes for its USB controllers |
370 | while the system is asleep, maintaining the connection, using true sleep | ||
371 | modes like "suspend-to-RAM" or "standby". (Don't write "disk" to the | ||
372 | /sys/power/state file; write "standby" or "mem".) We've not seen any | ||
373 | hardware that can use these modes through software suspend, although in | ||
374 | theory some systems might support "platform" or "firmware" modes that | ||
375 | won't break the USB connections. | ||
368 | 376 | ||
369 | Remember that it's always a bad idea to unplug a disk drive containing a | 377 | 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! | 378 | mounted filesystem. That's true even when your system is asleep! The |
371 | The safest thing is to unmount all USB-based filesystems before suspending | 379 | safest thing is to unmount all filesystems on removable media (such USB, |
372 | and remount them after resuming. | 380 | Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays) |
381 | before suspending; then remount them after resuming. | ||
373 | 382 | ||