aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2006-03-23 12:06:08 -0500
committerAnton Altaparmakov <aia21@cantab.net>2006-03-23 12:06:08 -0500
commit92fe7b9ea8ef101bff3c75ade89b93b5f62a7955 (patch)
tree3dba4faa78f1bbe4be503275173e3a63b5d60f22 /Documentation
parente750d1c7cc314b9ba1934b0b474b7d39f906f865 (diff)
parentb0e6e962992b76580f4900b166a337bad7c1e81b (diff)
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/kernel-parameters.txt11
-rw-r--r--Documentation/power/swsusp.txt51
-rw-r--r--Documentation/power/userland-swsusp.txt149
-rw-r--r--Documentation/power/video.txt74
4 files changed, 236 insertions, 49 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index fc99075e0af4..7b7382d0f758 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1008,7 +1008,9 @@ running once the system is up.
1008 noexec=on: enable non-executable mappings (default) 1008 noexec=on: enable non-executable mappings (default)
1009 noexec=off: disable nn-executable mappings 1009 noexec=off: disable nn-executable mappings
1010 1010
1011 nofxsr [BUGS=IA-32] 1011 nofxsr [BUGS=IA-32] Disables x86 floating point extended
1012 register save and restore. The kernel will only save
1013 legacy floating-point registers on task switch.
1012 1014
1013 nohlt [BUGS=ARM] 1015 nohlt [BUGS=ARM]
1014 1016
@@ -1053,6 +1055,8 @@ running once the system is up.
1053 1055
1054 nosbagart [IA-64] 1056 nosbagart [IA-64]
1055 1057
1058 nosep [BUGS=IA-32] Disables x86 SYSENTER/SYSEXIT support.
1059
1056 nosmp [SMP] Tells an SMP kernel to act as a UP kernel. 1060 nosmp [SMP] Tells an SMP kernel to act as a UP kernel.
1057 1061
1058 nosync [HW,M68K] Disables sync negotiation for all devices. 1062 nosync [HW,M68K] Disables sync negotiation for all devices.
@@ -1122,6 +1126,11 @@ running once the system is up.
1122 pas16= [HW,SCSI] 1126 pas16= [HW,SCSI]
1123 See header of drivers/scsi/pas16.c. 1127 See header of drivers/scsi/pas16.c.
1124 1128
1129 pause_on_oops=
1130 Halt all CPUs after the first oops has been printed for
1131 the specified number of seconds. This is to be used if
1132 your oopses keep scrolling off the screen.
1133
1125 pcbit= [HW,ISDN] 1134 pcbit= [HW,ISDN]
1126 1135
1127 pcd. [PARIDE] 1136 pcd. [PARIDE]
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
21You need to append resume=/dev/your_swap_partition to kernel command 26You need to append resume=/dev/your_swap_partition to kernel command
22line. Then you suspend by 27line. Then you suspend by
@@ -27,19 +32,18 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state
27 32
28echo platform > /sys/power/disk; echo disk > /sys/power/state 33echo 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
36support. For suspend and resume to work, make sure your disk drivers
37are built into kernel -- not modules. [There's way to make
38suspend/resume with modular disk drivers, see FAQ, but you probably
39should not do that.]
40
30If you want to limit the suspend image size to N bytes, do 41If you want to limit the suspend image size to N bytes, do
31 42
32echo N > /sys/power/image_size 43echo N > /sys/power/image_size
33 44
34before suspend (it is limited to 500 MB by default). 45before suspend (it is limited to 500 MB by default).
35 46
36Encrypted suspend image:
37------------------------
38If you want to store your suspend image encrypted with a temporary
39key to prevent data gathering after resume you must compile
40crypto and the aes algorithm into the kernel - modules won't work
41as they cannot be loaded at resume time.
42
43 47
44Article about goals and implementation of Software Suspend for Linux 48Article 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
333usually does the trick. Then it is good idea to try with latest 337usually does the trick. Then it is good idea to try with latest
334vanilla kernel. 338vanilla kernel.
335 339
340Q: How can distributions ship a swsusp-supporting kernel with modular
341disk drivers (especially SATA)?
342
343A: 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
345anything, not even read-only mount, or you are going to lose your
346data.
347
348Q: How do I make suspend more verbose?
349
350A: If you want to see any non-error kernel messages on the virtual
351terminal the kernel switches to during suspend, you have to set the
352kernel console loglevel to at least 5, for example by doing
353
354 echo 5 > /proc/sys/kernel/printk
355
356Q: Is this true that if I have a mounted filesystem on a USB device and
357I suspend to disk, I can lose data unless the filesystem has been mounted
358with "sync"?
359
360A: That's right. It depends on your hardware, and it could be true even for
361suspend-to-RAM. In fact, even with "-o sync" you can lose data if your
362programs have information in buffers they haven't written out to disk.
363
364If you're lucky, your hardware will support low-power modes for USB
365controllers while the system is asleep. Lots of hardware doesn't,
366however. Shutting off the power to a USB controller is equivalent to
367unplugging all the attached devices.
368
369Remember that it's always a bad idea to unplug a disk drive containing a
370mounted filesystem. With USB that's true even when your system is asleep!
371The safest thing is to unmount all USB-based filesystems before suspending
372and remount them after resuming.
336 373
diff --git a/Documentation/power/userland-swsusp.txt b/Documentation/power/userland-swsusp.txt
new file mode 100644
index 000000000000..94058220aaf0
--- /dev/null
+++ b/Documentation/power/userland-swsusp.txt
@@ -0,0 +1,149 @@
1Documentation for userland software suspend interface
2 (C) 2006 Rafael J. Wysocki <rjw@sisk.pl>
3
4First, the warnings at the beginning of swsusp.txt still apply.
5
6Second, you should read the FAQ in swsusp.txt _now_ if you have not
7done it already.
8
9Now, to use the userland interface for software suspend you need special
10utilities that will read/write the system memory snapshot from/to the
11kernel. Such utilities are available, for example, from
12<http://www.sisk.pl/kernel/utilities/suspend>. You may want to have
13a look at them if you are going to develop your own suspend/resume
14utilities.
15
16The interface consists of a character device providing the open(),
17release(), read(), and write() operations as well as several ioctl()
18commands defined in kernel/power/power.h. The major and minor
19numbers of the device are, respectively, 10 and 231, and they can
20be read from /sys/class/misc/snapshot/dev.
21
22The device can be open either for reading or for writing. If open for
23reading, it is considered to be in the suspend mode. Otherwise it is
24assumed to be in the resume mode. The device cannot be open for reading
25and writing. It is also impossible to have the device open more than once
26at a time.
27
28The ioctl() commands recognized by the device are:
29
30SNAPSHOT_FREEZE - freeze user space processes (the current process is
31 not frozen); this is required for SNAPSHOT_ATOMIC_SNAPSHOT
32 and SNAPSHOT_ATOMIC_RESTORE to succeed
33
34SNAPSHOT_UNFREEZE - thaw user space processes frozen by SNAPSHOT_FREEZE
35
36SNAPSHOT_ATOMIC_SNAPSHOT - create a snapshot of the system memory; the
37 last argument of ioctl() should be a pointer to an int variable,
38 the value of which will indicate whether the call returned after
39 creating the snapshot (1) or after restoring the system memory state
40 from it (0) (after resume the system finds itself finishing the
41 SNAPSHOT_ATOMIC_SNAPSHOT ioctl() again); after the snapshot
42 has been created the read() operation can be used to transfer
43 it out of the kernel
44
45SNAPSHOT_ATOMIC_RESTORE - restore the system memory state from the
46 uploaded snapshot image; before calling it you should transfer
47 the system memory snapshot back to the kernel using the write()
48 operation; this call will not succeed if the snapshot
49 image is not available to the kernel
50
51SNAPSHOT_FREE - free memory allocated for the snapshot image
52
53SNAPSHOT_SET_IMAGE_SIZE - set the preferred maximum size of the image
54 (the kernel will do its best to ensure the image size will not exceed
55 this number, but if it turns out to be impossible, the kernel will
56 create the smallest image possible)
57
58SNAPSHOT_AVAIL_SWAP - return the amount of available swap in bytes (the last
59 argument should be a pointer to an unsigned int variable that will
60 contain the result if the call is successful).
61
62SNAPSHOT_GET_SWAP_PAGE - allocate a swap page from the resume partition
63 (the last argument should be a pointer to a loff_t variable that
64 will contain the swap page offset if the call is successful)
65
66SNAPSHOT_FREE_SWAP_PAGES - free all swap pages allocated with
67 SNAPSHOT_GET_SWAP_PAGE
68
69SNAPSHOT_SET_SWAP_FILE - set the resume partition (the last ioctl() argument
70 should specify the device's major and minor numbers in the old
71 two-byte format, as returned by the stat() function in the .st_rdev
72 member of the stat structure); it is recommended to always use this
73 call, because the code to set the resume partition could be removed from
74 future kernels
75
76The device's read() operation can be used to transfer the snapshot image from
77the kernel. It has the following limitations:
78- you cannot read() more than one virtual memory page at a time
79- read()s accross page boundaries are impossible (ie. if ypu read() 1/2 of
80 a page in the previous call, you will only be able to read()
81 _at_ _most_ 1/2 of the page in the next call)
82
83The device's write() operation is used for uploading the system memory snapshot
84into the kernel. It has the same limitations as the read() operation.
85
86The release() operation frees all memory allocated for the snapshot image
87and all swap pages allocated with SNAPSHOT_GET_SWAP_PAGE (if any).
88Thus it is not necessary to use either SNAPSHOT_FREE or
89SNAPSHOT_FREE_SWAP_PAGES before closing the device (in fact it will also
90unfreeze user space processes frozen by SNAPSHOT_UNFREEZE if they are
91still frozen when the device is being closed).
92
93Currently it is assumed that the userland utilities reading/writing the
94snapshot image from/to the kernel will use a swap parition, called the resume
95partition, as storage space. However, this is not really required, as they
96can use, for example, a special (blank) suspend partition or a file on a partition
97that is unmounted before SNAPSHOT_ATOMIC_SNAPSHOT and mounted afterwards.
98
99These utilities SHOULD NOT make any assumptions regarding the ordering of
100data within the snapshot image, except for the image header that MAY be
101assumed to start with an swsusp_info structure, as specified in
102kernel/power/power.h. This structure MAY be used by the userland utilities
103to obtain some information about the snapshot image, such as the size
104of the snapshot image, including the metadata and the header itself,
105contained in the .size member of swsusp_info.
106
107The snapshot image MUST be written to the kernel unaltered (ie. all of the image
108data, metadata and header MUST be written in _exactly_ the same amount, form
109and order in which they have been read). Otherwise, the behavior of the
110resumed system may be totally unpredictable.
111
112While executing SNAPSHOT_ATOMIC_RESTORE the kernel checks if the
113structure of the snapshot image is consistent with the information stored
114in the image header. If any inconsistencies are detected,
115SNAPSHOT_ATOMIC_RESTORE will not succeed. Still, this is not a fool-proof
116mechanism and the userland utilities using the interface SHOULD use additional
117means, such as checksums, to ensure the integrity of the snapshot image.
118
119The suspending and resuming utilities MUST lock themselves in memory,
120preferrably using mlockall(), before calling SNAPSHOT_FREEZE.
121
122The suspending utility MUST check the value stored by SNAPSHOT_ATOMIC_SNAPSHOT
123in the memory location pointed to by the last argument of ioctl() and proceed
124in accordance with it:
1251. If the value is 1 (ie. the system memory snapshot has just been
126 created and the system is ready for saving it):
127 (a) The suspending utility MUST NOT close the snapshot device
128 _unless_ the whole suspend procedure is to be cancelled, in
129 which case, if the snapshot image has already been saved, the
130 suspending utility SHOULD destroy it, preferrably by zapping
131 its header. If the suspend is not to be cancelled, the
132 system MUST be powered off or rebooted after the snapshot
133 image has been saved.
134 (b) The suspending utility SHOULD NOT attempt to perform any
135 file system operations (including reads) on the file systems
136 that were mounted before SNAPSHOT_ATOMIC_SNAPSHOT has been
137 called. However, it MAY mount a file system that was not
138 mounted at that time and perform some operations on it (eg.
139 use it for saving the image).
1402. If the value is 0 (ie. the system state has just been restored from
141 the snapshot image), the suspending utility MUST close the snapshot
142 device. Afterwards it will be treated as a regular userland process,
143 so it need not exit.
144
145The resuming utility SHOULD NOT attempt to mount any file systems that could
146be mounted before suspend and SHOULD NOT attempt to perform any operations
147involving such file systems.
148
149For details, please refer to the source code.
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
6During S3 resume, hardware needs to be reinitialized. For most 6During S3 resume, hardware needs to be reinitialized. For most
7devices, this is easy, and kernel driver knows how to do 7devices, 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
15problem for S1 standby, because hardware should retain its state over 15problem for S1 standby, because hardware should retain its state over
16that. 16that.
17 17
18We either have to run video BIOS during early resume, or interpret it
19using vbetool later, or maybe nothing is neccessary on particular
20system because video state is preserved. Unfortunately different
21methods work on different systems, and no known method suits all of
22them.
23
24Userland application called s2ram has been developed; it contains long
25whitelist of systems, and automatically selects working method for a
26given system. It can be downloaded from CVS at
27www.sf.net/projects/suspend . If you get a system that is not in the
28whitelist, please try to find a working solution, and submit whitelist
29entry so that work does not need to be repeated.
30
31Currently, VBE_SAVE method (6 below) works on most
32systems. Unfortunately, vbetool only runs after userland is resumed,
33so it makes debugging of early resume problems
34hard/impossible. Methods that do not rely on userland are preferable.
35
36Details
37~~~~~~~
38
18There are a few types of systems where video works after S3 resume: 39There 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 ??? (*)
104HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X 125HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X
105HP Omnibook XE3 athlon version none (1) 126HP Omnibook XE3 athlon version none (1)
106HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV 127HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV
128HP Omnibook 5150 none (1), (S1 also works OK)
107IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work. 129IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work.
108IBM 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 :-(] 130IBM 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 :-(]
109IBM TP R32 / Type 2658-MMG none (1) 131IBM TP R32 / Type 2658-MMG none (1)
@@ -120,18 +142,24 @@ IBM ThinkPad T42p (2373-GTG) s3_bios (2)
120IBM TP X20 ??? (*) 142IBM TP X20 ??? (*)
121IBM TP X30 s3_bios (2) 143IBM TP X30 s3_bios (2)
122IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. 144IBM 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 145IBM 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?
124IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) 146IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
147IBM TP 600e none(1), but a switch to console and back to X is needed
125Medion MD4220 ??? (*) 148Medion MD4220 ??? (*)
126Samsung P35 vbetool needed (6) 149Samsung P35 vbetool needed (6)
127Sharp PC-AR10 (ATI rage) none (1) 150Sharp PC-AR10 (ATI rage) none (1), backlight does not switch off
128Sony Vaio PCG-C1VRX/K s3_bios (2) 151Sony Vaio PCG-C1VRX/K s3_bios (2)
129Sony Vaio PCG-F403 ??? (*) 152Sony Vaio PCG-F403 ??? (*)
153Sony Vaio PCG-GRT995MP none (1), works with 'nv' X driver
154Sony Vaio PCG-GR7/K none (1), but needs radeonfb, use radeontool (http://fdd.com/software/radeon/) to turn off backlight.
130Sony Vaio PCG-N505SN ??? (*) 155Sony Vaio PCG-N505SN ??? (*)
131Sony Vaio vgn-s260 X or boot-radeon can init it (5) 156Sony Vaio vgn-s260 X or boot-radeon can init it (5)
157Sony Vaio vgn-S580BH vga=normal, but suspend from X. Console will be blank unless you return to X.
158Sony Vaio vgn-FS115B s3_bios (2),s3_mode (4)
132Toshiba Libretto L5 none (1) 159Toshiba Libretto L5 none (1)
133Toshiba Satellite 4030CDT s3_mode (3) 160Toshiba Portege 3020CT s3_mode (3)
134Toshiba Satellite 4080XCDT s3_mode (3) 161Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK)
162Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK)
135Toshiba Satellite 4090XCDT ??? (*) 163Toshiba Satellite 4090XCDT ??? (*)
136Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) 164Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****)
137Toshiba M30 (2) xor X with nvidia driver using internal AGP 165Toshiba 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
155VBEtool details
156~~~~~~~~~~~~~~~
157(with thanks to Carl-Daniel Hailfinger)
158
159First, boot into X and run the following script ONCE:
160#!/bin/bash
161statedir=/root/s3/state
162mkdir -p $statedir
163chvt 2
164sleep 1
165vbetool vbestate save >$statedir/vbe
166
167
168To suspend and resume properly, call the following script as root:
169#!/bin/bash
170statedir=/root/s3/state
171curcons=`fgconsole`
172fuser /dev/tty$curcons 2>/dev/null|xargs ps -o comm= -p|grep -q X && chvt 2
173cat /dev/vcsa >$statedir/vcsa
174sync
175echo 3 >/proc/acpi/sleep
176sync
177vbetool post
178vbetool vbestate restore <$statedir/vbe
179cat $statedir/vcsa >/dev/vcsa
180rckbd restart
181chvt $[curcons%6+1]
182chvt $curcons
183
184
185Unless you change your graphics card or other hardware configuration,
186the state once saved will be OK for every resume afterwards.
187NOTE: The "rckbd restart" command may be different for your
188distribution. Simply replace it with the command you would use to
189set the fonts on screen.