diff options
Diffstat (limited to 'Documentation/power')
-rw-r--r-- | Documentation/power/kernel_threads.txt | 3 | ||||
-rw-r--r-- | Documentation/power/pci.txt | 38 | ||||
-rw-r--r-- | Documentation/power/swsusp.txt | 84 | ||||
-rw-r--r-- | Documentation/power/video.txt | 4 | ||||
-rw-r--r-- | Documentation/power/video_extension.txt | 19 |
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 | ||
19 | from drivers/usb/core/hub.c::hub_thread() | 18 | from 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 | |||
291 | pci_enable_wake (one for both D3hot and D3cold). | 291 | pci_enable_wake (one for both D3hot and D3cold). |
292 | 292 | ||
293 | 293 | ||
294 | A 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 | |||
327 | This is a typical implementation. Drivers can slightly change the order | ||
328 | of the operations in the implementation, ignore some operations or add | ||
329 | more deriver specific operations in it, but drivers should do something like | ||
330 | this on the whole. | ||
331 | |||
294 | 5. Resources | 332 | 5. 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 | |||
164 | should be held at that point and it must be safe to sleep there), and | 164 | should be held at that point and it must be safe to sleep there), and |
165 | add: | 165 | add: |
166 | 166 | ||
167 | if (current->flags & PF_FREEZE) | 167 | try_to_freeze(); |
168 | refrigerator(PF_FREEZE); | ||
169 | 168 | ||
170 | If the thread is needed for writing the image to storage, you should | 169 | If the thread is needed for writing the image to storage, you should |
171 | instead set the PF_NOFREEZE process flag when creating the thread. | 170 | instead set the PF_NOFREEZE process flag when creating the thread (and |
171 | be very carefull). | ||
172 | 172 | ||
173 | 173 | ||
174 | Q: What is the difference between between "platform", "shutdown" and | 174 | Q: What is the difference between between "platform", "shutdown" and |
@@ -233,3 +233,81 @@ A: Try running | |||
233 | cat `cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u` > /dev/null | 233 | cat `cat /proc/[0-9]*/maps | grep / | sed 's:.* /:/:' | sort -u` > /dev/null |
234 | 234 | ||
235 | after resume. swapoff -a; swapon -a may also be usefull. | 235 | after resume. swapoff -a; swapon -a may also be usefull. |
236 | |||
237 | Q: What happens to devices during swsusp? They seem to be resumed | ||
238 | during system suspend? | ||
239 | |||
240 | A: That's correct. We need to resume them if we want to write image to | ||
241 | disk. 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 | |||
281 | Q: What is this 'Encrypt suspend image' for? | ||
282 | |||
283 | A: First of all: it is not a replacement for dm-crypt encrypted swap. | ||
284 | It cannot protect your computer while it is suspended. Instead it does | ||
285 | protect from leaking sensitive data after resume from suspend. | ||
286 | |||
287 | Think of the following: you suspend while an application is running | ||
288 | that keeps sensitive data in memory. The application itself prevents | ||
289 | the data from being swapped out. Suspend, however, must write these | ||
290 | data to swap to be able to resume later on. Without suspend encryption | ||
291 | your sensitive data are then stored in plaintext on disk. This means | ||
292 | that after resume your sensitive data are accessible to all | ||
293 | applications having direct access to the swap device which was used | ||
294 | for suspend. If you don't need swap after resume these data can remain | ||
295 | on disk virtually forever. Thus it can happen that your system gets | ||
296 | broken in weeks later and sensitive data which you thought were | ||
297 | encrypted and protected are retrieved and stolen from the swap device. | ||
298 | To prevent this situation you should use 'Encrypt suspend image'. | ||
299 | |||
300 | During suspend a temporary key is created and this key is used to | ||
301 | encrypt the data written to disk. When, during resume, the data was | ||
302 | read back into memory the temporary key is destroyed which simply | ||
303 | means that all data written to disk during suspend are then | ||
304 | inaccessible so they can't be stolen later on. The only thing that | ||
305 | you must then take care of is that you call 'mkswap' for the swap | ||
306 | partition used for suspend as early as possible during regular | ||
307 | boot. This asserts that any temporary key from an oopsed suspend or | ||
308 | from a failed or aborted resume is erased from the swap device. | ||
309 | |||
310 | As a rule of thumb use encrypted swap to protect your data while your | ||
311 | system is shut down or suspended. Additionally use the encrypted | ||
312 | suspend image to prevent sensitive data from being stolen after | ||
313 | resume. | ||
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) | |||
83 | Compaq Evo N620c vga=normal, s3_bios (2) | 83 | Compaq Evo N620c vga=normal, s3_bios (2) |
84 | Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1 | 84 | Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1 |
85 | Dell D600, ATI RV250 vga=normal and X, or try vbestate (6) | 85 | Dell D600, ATI RV250 vga=normal and X, or try vbestate (6) |
86 | Dell D610 vga=normal and X (possibly vbestate (6) too, but not tested) | ||
86 | Dell Inspiron 4000 ??? (*) | 87 | Dell Inspiron 4000 ??? (*) |
87 | Dell Inspiron 500m ??? (*) | 88 | Dell Inspiron 500m ??? (*) |
89 | Dell Inspiron 510m ??? | ||
88 | Dell Inspiron 600m ??? (*) | 90 | Dell Inspiron 600m ??? (*) |
89 | Dell Inspiron 8200 ??? (*) | 91 | Dell Inspiron 8200 ??? (*) |
90 | Dell Inspiron 8500 ??? (*) | 92 | Dell Inspiron 8500 ??? (*) |
@@ -115,6 +117,7 @@ IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) | |||
115 | Medion MD4220 ??? (*) | 117 | Medion MD4220 ??? (*) |
116 | Samsung P35 vbetool needed (6) | 118 | Samsung P35 vbetool needed (6) |
117 | Sharp PC-AR10 (ATI rage) none (1) | 119 | Sharp PC-AR10 (ATI rage) none (1) |
120 | Sony Vaio PCG-C1VRX/K s3_bios (2) | ||
118 | Sony Vaio PCG-F403 ??? (*) | 121 | Sony Vaio PCG-F403 ??? (*) |
119 | Sony Vaio PCG-N505SN ??? (*) | 122 | Sony Vaio PCG-N505SN ??? (*) |
120 | Sony Vaio vgn-s260 X or boot-radeon can init it (5) | 123 | Sony Vaio vgn-s260 X or boot-radeon can init it (5) |
@@ -123,6 +126,7 @@ Toshiba Satellite 4030CDT s3_mode (3) | |||
123 | Toshiba Satellite 4080XCDT s3_mode (3) | 126 | Toshiba Satellite 4080XCDT s3_mode (3) |
124 | Toshiba Satellite 4090XCDT ??? (*) | 127 | Toshiba Satellite 4090XCDT ??? (*) |
125 | Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) | 128 | Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) |
129 | Toshiba M30 (2) xor X with nvidia driver using internal AGP | ||
126 | Uniwill 244IIO ??? (*) | 130 | Uniwill 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 @@ | |||
1 | This driver implement the ACPI Extensions For Display Adapters | 1 | ACPI video extensions |
2 | for integrated graphics devices on motherboard, as specified in | 2 | ~~~~~~~~~~~~~~~~~~~~~ |
3 | ACPI 2.0 Specification, Appendix B, allowing to perform some basic | 3 | |
4 | control like defining the video POST device, retrieving EDID information | 4 | This driver implement the ACPI Extensions For Display Adapters for |
5 | or to setup a video output, etc. Note that this is an ref. implementation only. | 5 | integrated graphics devices on motherboard, as specified in ACPI 2.0 |
6 | It may or may not work for your integrated video device. | 6 | Specification, Appendix B, allowing to perform some basic control like |
7 | defining the video POST device, retrieving EDID information or to | ||
8 | setup a video output, etc. Note that this is an ref. implementation | ||
9 | only. It may or may not work for your integrated video device. | ||
7 | 10 | ||
8 | Interfaces exposed to userland through /proc/acpi/video: | 11 | Interfaces exposed to userland through /proc/acpi/video: |
9 | 12 | ||
10 | VGA/info : display the supported video bus device capability like ,Video ROM, CRT/LCD/TV. | 13 | VGA/info : display the supported video bus device capability like Video ROM, CRT/LCD/TV. |
11 | VGA/ROM : Used to get a copy of the display devices' ROM data (up to 4k). | 14 | VGA/ROM : Used to get a copy of the display devices' ROM data (up to 4k). |
12 | VGA/POST_info : Used to determine what options are implemented. | 15 | VGA/POST_info : Used to determine what options are implemented. |
13 | VGA/POST : Used to get/set POST device. | 16 | VGA/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 |
16 | VGA/CRT : CRT output | 19 | VGA/CRT : CRT output |
17 | VGA/LCD : LCD output | 20 | VGA/LCD : LCD output |
18 | VGA/TV : TV output | 21 | VGA/TVO : TV output |
19 | VGA/*/brightness : Used to get/set brightness of output device | 22 | VGA/*/brightness : Used to get/set brightness of output device |
20 | 23 | ||
21 | Notify event through /proc/acpi/event: | 24 | Notify event through /proc/acpi/event: |