aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/kernel_threads.txt3
-rw-r--r--Documentation/power/pci.txt38
-rw-r--r--Documentation/power/swsusp.txt84
-rw-r--r--Documentation/power/video.txt4
-rw-r--r--Documentation/power/video_extension.txt19
5 files changed, 135 insertions, 13 deletions
diff --git a/Documentation/power/kernel_threads.txt b/Documentation/power/kernel_threads.txt
index 60b548105edf..fb57784986b1 100644
--- a/Documentation/power/kernel_threads.txt
+++ b/Documentation/power/kernel_threads.txt
@@ -12,8 +12,7 @@ refrigerator. Code to do this looks like this:
12 do { 12 do {
13 hub_events(); 13 hub_events();
14 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list)); 14 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
15 if (current->flags & PF_FREEZE) 15 try_to_freeze();
16 refrigerator(PF_FREEZE);
17 } while (!signal_pending(current)); 16 } while (!signal_pending(current));
18 17
19from drivers/usb/core/hub.c::hub_thread() 18from drivers/usb/core/hub.c::hub_thread()
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt
index 35b1a7dae342..6fc9d511fc39 100644
--- a/Documentation/power/pci.txt
+++ b/Documentation/power/pci.txt
@@ -291,6 +291,44 @@ a request to enable wake events from D3, two calls should be made to
291pci_enable_wake (one for both D3hot and D3cold). 291pci_enable_wake (one for both D3hot and D3cold).
292 292
293 293
294A reference implementation
295-------------------------
296.suspend()
297{
298 /* driver specific operations */
299
300 /* Disable IRQ */
301 free_irq();
302 /* If using MSI */
303 pci_disable_msi();
304
305 pci_save_state();
306 pci_enable_wake();
307 /* Disable IO/bus master/irq router */
308 pci_disable_device();
309 pci_set_power_state(pci_choose_state());
310}
311
312.resume()
313{
314 pci_set_power_state(PCI_D0);
315 pci_restore_state();
316 /* device's irq possibly is changed, driver should take care */
317 pci_enable_device();
318 pci_set_master();
319
320 /* if using MSI, device's vector possibly is changed */
321 pci_enable_msi();
322
323 request_irq();
324 /* driver specific operations; */
325}
326
327This is a typical implementation. Drivers can slightly change the order
328of the operations in the implementation, ignore some operations or add
329more deriver specific operations in it, but drivers should do something like
330this on the whole.
331
2945. Resources 3325. Resources
295~~~~~~~~~~~~ 333~~~~~~~~~~~~
296 334
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index c7c3459fde43..7a6b78966459 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -164,11 +164,11 @@ place where the thread is safe to be frozen (no kernel semaphores
164should be held at that point and it must be safe to sleep there), and 164should be held at that point and it must be safe to sleep there), and
165add: 165add:
166 166
167 if (current->flags & PF_FREEZE) 167 try_to_freeze();
168 refrigerator(PF_FREEZE);
169 168
170If the thread is needed for writing the image to storage, you should 169If the thread is needed for writing the image to storage, you should
171instead set the PF_NOFREEZE process flag when creating the thread. 170instead set the PF_NOFREEZE process flag when creating the thread (and
171be very carefull).
172 172
173 173
174Q: What is the difference between between "platform", "shutdown" and 174Q: What is the difference between between "platform", "shutdown" and
@@ -233,3 +233,81 @@ A: Try running
233cat `cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u` > /dev/null 233cat `cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u` > /dev/null
234 234
235after resume. swapoff -a; swapon -a may also be usefull. 235after resume. swapoff -a; swapon -a may also be usefull.
236
237Q: What happens to devices during swsusp? They seem to be resumed
238during system suspend?
239
240A: That's correct. We need to resume them if we want to write image to
241disk. Whole sequence goes like
242
243 Suspend part
244 ~~~~~~~~~~~~
245 running system, user asks for suspend-to-disk
246
247 user processes are stopped
248
249 suspend(PMSG_FREEZE): devices are frozen so that they don't interfere
250 with state snapshot
251
252 state snapshot: copy of whole used memory is taken with interrupts disabled
253
254 resume(): devices are woken up so that we can write image to swap
255
256 write image to swap
257
258 suspend(PMSG_SUSPEND): suspend devices so that we can power off
259
260 turn the power off
261
262 Resume part
263 ~~~~~~~~~~~
264 (is actually pretty similar)
265
266 running system, user asks for suspend-to-disk
267
268 user processes are stopped (in common case there are none, but with resume-from-initrd, noone knows)
269
270 read image from disk
271
272 suspend(PMSG_FREEZE): devices are frozen so that they don't interfere
273 with image restoration
274
275 image restoration: rewrite memory with image
276
277 resume(): devices are woken up so that system can continue
278
279 thaw all user processes
280
281Q: What is this 'Encrypt suspend image' for?
282
283A: First of all: it is not a replacement for dm-crypt encrypted swap.
284It cannot protect your computer while it is suspended. Instead it does
285protect from leaking sensitive data after resume from suspend.
286
287Think of the following: you suspend while an application is running
288that keeps sensitive data in memory. The application itself prevents
289the data from being swapped out. Suspend, however, must write these
290data to swap to be able to resume later on. Without suspend encryption
291your sensitive data are then stored in plaintext on disk. This means
292that after resume your sensitive data are accessible to all
293applications having direct access to the swap device which was used
294for suspend. If you don't need swap after resume these data can remain
295on disk virtually forever. Thus it can happen that your system gets
296broken in weeks later and sensitive data which you thought were
297encrypted and protected are retrieved and stolen from the swap device.
298To prevent this situation you should use 'Encrypt suspend image'.
299
300During suspend a temporary key is created and this key is used to
301encrypt the data written to disk. When, during resume, the data was
302read back into memory the temporary key is destroyed which simply
303means that all data written to disk during suspend are then
304inaccessible so they can't be stolen later on. The only thing that
305you must then take care of is that you call 'mkswap' for the swap
306partition used for suspend as early as possible during regular
307boot. This asserts that any temporary key from an oopsed suspend or
308from a failed or aborted resume is erased from the swap device.
309
310As a rule of thumb use encrypted swap to protect your data while your
311system is shut down or suspended. Additionally use the encrypted
312suspend image to prevent sensitive data from being stolen after
313resume.
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index 68734355d7cf..7a4a5036d123 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -83,8 +83,10 @@ Compaq Armada E500 - P3-700 none (1) (S1 also works OK)
83Compaq Evo N620c vga=normal, s3_bios (2) 83Compaq Evo N620c vga=normal, s3_bios (2)
84Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1 84Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1
85Dell D600, ATI RV250 vga=normal and X, or try vbestate (6) 85Dell D600, ATI RV250 vga=normal and X, or try vbestate (6)
86Dell D610 vga=normal and X (possibly vbestate (6) too, but not tested)
86Dell Inspiron 4000 ??? (*) 87Dell Inspiron 4000 ??? (*)
87Dell Inspiron 500m ??? (*) 88Dell Inspiron 500m ??? (*)
89Dell Inspiron 510m ???
88Dell Inspiron 600m ??? (*) 90Dell Inspiron 600m ??? (*)
89Dell Inspiron 8200 ??? (*) 91Dell Inspiron 8200 ??? (*)
90Dell Inspiron 8500 ??? (*) 92Dell Inspiron 8500 ??? (*)
@@ -115,6 +117,7 @@ IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
115Medion MD4220 ??? (*) 117Medion MD4220 ??? (*)
116Samsung P35 vbetool needed (6) 118Samsung P35 vbetool needed (6)
117Sharp PC-AR10 (ATI rage) none (1) 119Sharp PC-AR10 (ATI rage) none (1)
120Sony Vaio PCG-C1VRX/K s3_bios (2)
118Sony Vaio PCG-F403 ??? (*) 121Sony Vaio PCG-F403 ??? (*)
119Sony Vaio PCG-N505SN ??? (*) 122Sony Vaio PCG-N505SN ??? (*)
120Sony Vaio vgn-s260 X or boot-radeon can init it (5) 123Sony Vaio vgn-s260 X or boot-radeon can init it (5)
@@ -123,6 +126,7 @@ Toshiba Satellite 4030CDT s3_mode (3)
123Toshiba Satellite 4080XCDT s3_mode (3) 126Toshiba Satellite 4080XCDT s3_mode (3)
124Toshiba Satellite 4090XCDT ??? (*) 127Toshiba Satellite 4090XCDT ??? (*)
125Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) 128Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****)
129Toshiba M30 (2) xor X with nvidia driver using internal AGP
126Uniwill 244IIO ??? (*) 130Uniwill 244IIO ??? (*)
127 131
128 132
diff --git a/Documentation/power/video_extension.txt b/Documentation/power/video_extension.txt
index 8e33d7c82c49..b2f9b1598ac2 100644
--- a/Documentation/power/video_extension.txt
+++ b/Documentation/power/video_extension.txt
@@ -1,13 +1,16 @@
1This driver implement the ACPI Extensions For Display Adapters 1ACPI video extensions
2for integrated graphics devices on motherboard, as specified in 2~~~~~~~~~~~~~~~~~~~~~
3ACPI 2.0 Specification, Appendix B, allowing to perform some basic 3
4control like defining the video POST device, retrieving EDID information 4This driver implement the ACPI Extensions For Display Adapters for
5or to setup a video output, etc. Note that this is an ref. implementation only. 5integrated graphics devices on motherboard, as specified in ACPI 2.0
6It may or may not work for your integrated video device. 6Specification, Appendix B, allowing to perform some basic control like
7defining the video POST device, retrieving EDID information or to
8setup a video output, etc. Note that this is an ref. implementation
9only. It may or may not work for your integrated video device.
7 10
8Interfaces exposed to userland through /proc/acpi/video: 11Interfaces exposed to userland through /proc/acpi/video:
9 12
10VGA/info : display the supported video bus device capability like ,Video ROM, CRT/LCD/TV. 13VGA/info : display the supported video bus device capability like Video ROM, CRT/LCD/TV.
11VGA/ROM : Used to get a copy of the display devices' ROM data (up to 4k). 14VGA/ROM : Used to get a copy of the display devices' ROM data (up to 4k).
12VGA/POST_info : Used to determine what options are implemented. 15VGA/POST_info : Used to determine what options are implemented.
13VGA/POST : Used to get/set POST device. 16VGA/POST : Used to get/set POST device.
@@ -15,7 +18,7 @@ VGA/DOS : Used to get/set ownership of output switching:
15 Please refer ACPI spec B.4.1 _DOS 18 Please refer ACPI spec B.4.1 _DOS
16VGA/CRT : CRT output 19VGA/CRT : CRT output
17VGA/LCD : LCD output 20VGA/LCD : LCD output
18VGA/TV : TV output 21VGA/TVO : TV output
19VGA/*/brightness : Used to get/set brightness of output device 22VGA/*/brightness : Used to get/set brightness of output device
20 23
21Notify event through /proc/acpi/event: 24Notify event through /proc/acpi/event: