diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 13:15:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 13:15:51 -0400 |
commit | c7c66c0cb0c77b1a8edf09bca57d922312d58030 (patch) | |
tree | 77277103c5f16aa4dee64978a060933d92e14776 /Documentation | |
parent | 9f3938346a5c1fa504647670edb5fea5756cfb00 (diff) | |
parent | 98e8bdafeb4728a6af7bbcbcc3984967d1cf2bc1 (diff) |
Merge tag 'pm-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates for 3.4 from Rafael Wysocki:
"Assorted extensions and fixes including:
* Introduction of early/late suspend/hibernation device callbacks.
* Generic PM domains extensions and fixes.
* devfreq updates from Axel Lin and MyungJoo Ham.
* Device PM QoS updates.
* Fixes of concurrency problems with wakeup sources.
* System suspend and hibernation fixes."
* tag 'pm-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (43 commits)
PM / Domains: Check domain status during hibernation restore of devices
PM / devfreq: add relation of recommended frequency.
PM / shmobile: Make MTU2 driver use pm_genpd_dev_always_on()
PM / shmobile: Make CMT driver use pm_genpd_dev_always_on()
PM / shmobile: Make TMU driver use pm_genpd_dev_always_on()
PM / Domains: Introduce "always on" device flag
PM / Domains: Fix hibernation restore of devices, v2
PM / Domains: Fix handling of wakeup devices during system resume
sh_mmcif / PM: Use PM QoS latency constraint
tmio_mmc / PM: Use PM QoS latency constraint
PM / QoS: Make it possible to expose PM QoS latency constraints
PM / Sleep: JBD and JBD2 missing set_freezable()
PM / Domains: Fix include for PM_GENERIC_DOMAINS=n case
PM / Freezer: Remove references to TIF_FREEZE in comments
PM / Sleep: Add more wakeup source initialization routines
PM / Hibernate: Enable usermodehelpers in hibernate() error path
PM / Sleep: Make __pm_stay_awake() delete wakeup source timers
PM / Sleep: Fix race conditions related to wakeup source timer function
PM / Sleep: Fix possible infinite loop during wakeup source destruction
PM / Hibernate: print physical addresses consistently with other parts of kernel
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-devices-power | 18 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 21 | ||||
-rw-r--r-- | Documentation/power/devices.txt | 93 | ||||
-rw-r--r-- | Documentation/power/freezing-of-tasks.txt | 21 |
4 files changed, 121 insertions, 32 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power index 8ffbc25376a0..840f7d64d483 100644 --- a/Documentation/ABI/testing/sysfs-devices-power +++ b/Documentation/ABI/testing/sysfs-devices-power | |||
@@ -165,3 +165,21 @@ Description: | |||
165 | 165 | ||
166 | Not all drivers support this attribute. If it isn't supported, | 166 | Not all drivers support this attribute. If it isn't supported, |
167 | attempts to read or write it will yield I/O errors. | 167 | attempts to read or write it will yield I/O errors. |
168 | |||
169 | What: /sys/devices/.../power/pm_qos_latency_us | ||
170 | Date: March 2012 | ||
171 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
172 | Description: | ||
173 | The /sys/devices/.../power/pm_qos_resume_latency_us attribute | ||
174 | contains the PM QoS resume latency limit for the given device, | ||
175 | which is the maximum allowed time it can take to resume the | ||
176 | device, after it has been suspended at run time, from a resume | ||
177 | request to the moment the device will be ready to process I/O, | ||
178 | in microseconds. If it is equal to 0, however, this means that | ||
179 | the PM QoS resume latency may be arbitrary. | ||
180 | |||
181 | Not all drivers support this attribute. If it isn't supported, | ||
182 | it is not present. | ||
183 | |||
184 | This attribute has no effect on system-wide suspend/resume and | ||
185 | hibernation. | ||
diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt new file mode 100644 index 000000000000..6528e215c5fe --- /dev/null +++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | * Samsung Exynos Power Domains | ||
2 | |||
3 | Exynos processors include support for multiple power domains which are used | ||
4 | to gate power to one or more peripherals on the processor. | ||
5 | |||
6 | Required Properties: | ||
7 | - compatiable: should be one of the following. | ||
8 | * samsung,exynos4210-pd - for exynos4210 type power domain. | ||
9 | - reg: physical base address of the controller and length of memory mapped | ||
10 | region. | ||
11 | |||
12 | Optional Properties: | ||
13 | - samsung,exynos4210-pd-off: Specifies that the power domain is in turned-off | ||
14 | state during boot and remains to be turned-off until explicitly turned-on. | ||
15 | |||
16 | Example: | ||
17 | |||
18 | lcd0: power-domain-lcd0 { | ||
19 | compatible = "samsung,exynos4210-pd"; | ||
20 | reg = <0x10023C00 0x10>; | ||
21 | }; | ||
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 20af7def23c8..872815cd41d3 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -96,6 +96,12 @@ struct dev_pm_ops { | |||
96 | int (*thaw)(struct device *dev); | 96 | int (*thaw)(struct device *dev); |
97 | int (*poweroff)(struct device *dev); | 97 | int (*poweroff)(struct device *dev); |
98 | int (*restore)(struct device *dev); | 98 | int (*restore)(struct device *dev); |
99 | int (*suspend_late)(struct device *dev); | ||
100 | int (*resume_early)(struct device *dev); | ||
101 | int (*freeze_late)(struct device *dev); | ||
102 | int (*thaw_early)(struct device *dev); | ||
103 | int (*poweroff_late)(struct device *dev); | ||
104 | int (*restore_early)(struct device *dev); | ||
99 | int (*suspend_noirq)(struct device *dev); | 105 | int (*suspend_noirq)(struct device *dev); |
100 | int (*resume_noirq)(struct device *dev); | 106 | int (*resume_noirq)(struct device *dev); |
101 | int (*freeze_noirq)(struct device *dev); | 107 | int (*freeze_noirq)(struct device *dev); |
@@ -305,7 +311,7 @@ Entering System Suspend | |||
305 | ----------------------- | 311 | ----------------------- |
306 | When the system goes into the standby or memory sleep state, the phases are: | 312 | When the system goes into the standby or memory sleep state, the phases are: |
307 | 313 | ||
308 | prepare, suspend, suspend_noirq. | 314 | prepare, suspend, suspend_late, suspend_noirq. |
309 | 315 | ||
310 | 1. The prepare phase is meant to prevent races by preventing new devices | 316 | 1. The prepare phase is meant to prevent races by preventing new devices |
311 | from being registered; the PM core would never know that all the | 317 | from being registered; the PM core would never know that all the |
@@ -324,7 +330,12 @@ When the system goes into the standby or memory sleep state, the phases are: | |||
324 | appropriate low-power state, depending on the bus type the device is on, | 330 | appropriate low-power state, depending on the bus type the device is on, |
325 | and they may enable wakeup events. | 331 | and they may enable wakeup events. |
326 | 332 | ||
327 | 3. The suspend_noirq phase occurs after IRQ handlers have been disabled, | 333 | 3 For a number of devices it is convenient to split suspend into the |
334 | "quiesce device" and "save device state" phases, in which cases | ||
335 | suspend_late is meant to do the latter. It is always executed after | ||
336 | runtime power management has been disabled for all devices. | ||
337 | |||
338 | 4. The suspend_noirq phase occurs after IRQ handlers have been disabled, | ||
328 | which means that the driver's interrupt handler will not be called while | 339 | which means that the driver's interrupt handler will not be called while |
329 | the callback method is running. The methods should save the values of | 340 | the callback method is running. The methods should save the values of |
330 | the device's registers that weren't saved previously and finally put the | 341 | the device's registers that weren't saved previously and finally put the |
@@ -359,7 +370,7 @@ Leaving System Suspend | |||
359 | ---------------------- | 370 | ---------------------- |
360 | When resuming from standby or memory sleep, the phases are: | 371 | When resuming from standby or memory sleep, the phases are: |
361 | 372 | ||
362 | resume_noirq, resume, complete. | 373 | resume_noirq, resume_early, resume, complete. |
363 | 374 | ||
364 | 1. The resume_noirq callback methods should perform any actions needed | 375 | 1. The resume_noirq callback methods should perform any actions needed |
365 | before the driver's interrupt handlers are invoked. This generally | 376 | before the driver's interrupt handlers are invoked. This generally |
@@ -375,14 +386,18 @@ When resuming from standby or memory sleep, the phases are: | |||
375 | device driver's ->pm.resume_noirq() method to perform device-specific | 386 | device driver's ->pm.resume_noirq() method to perform device-specific |
376 | actions. | 387 | actions. |
377 | 388 | ||
378 | 2. The resume methods should bring the the device back to its operating | 389 | 2. The resume_early methods should prepare devices for the execution of |
390 | the resume methods. This generally involves undoing the actions of the | ||
391 | preceding suspend_late phase. | ||
392 | |||
393 | 3 The resume methods should bring the the device back to its operating | ||
379 | state, so that it can perform normal I/O. This generally involves | 394 | state, so that it can perform normal I/O. This generally involves |
380 | undoing the actions of the suspend phase. | 395 | undoing the actions of the suspend phase. |
381 | 396 | ||
382 | 3. The complete phase uses only a bus callback. The method should undo the | 397 | 4. The complete phase should undo the actions of the prepare phase. Note, |
383 | actions of the prepare phase. Note, however, that new children may be | 398 | however, that new children may be registered below the device as soon as |
384 | registered below the device as soon as the resume callbacks occur; it's | 399 | the resume callbacks occur; it's not necessary to wait until the |
385 | not necessary to wait until the complete phase. | 400 | complete phase. |
386 | 401 | ||
387 | At the end of these phases, drivers should be as functional as they were before | 402 | At the end of these phases, drivers should be as functional as they were before |
388 | suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are | 403 | suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are |
@@ -429,8 +444,8 @@ an image of the system memory while everything is stable, reactivate all | |||
429 | devices (thaw), write the image to permanent storage, and finally shut down the | 444 | devices (thaw), write the image to permanent storage, and finally shut down the |
430 | system (poweroff). The phases used to accomplish this are: | 445 | system (poweroff). The phases used to accomplish this are: |
431 | 446 | ||
432 | prepare, freeze, freeze_noirq, thaw_noirq, thaw, complete, | 447 | prepare, freeze, freeze_late, freeze_noirq, thaw_noirq, thaw_early, |
433 | prepare, poweroff, poweroff_noirq | 448 | thaw, complete, prepare, poweroff, poweroff_late, poweroff_noirq |
434 | 449 | ||
435 | 1. The prepare phase is discussed in the "Entering System Suspend" section | 450 | 1. The prepare phase is discussed in the "Entering System Suspend" section |
436 | above. | 451 | above. |
@@ -441,7 +456,11 @@ system (poweroff). The phases used to accomplish this are: | |||
441 | save time it's best not to do so. Also, the device should not be | 456 | save time it's best not to do so. Also, the device should not be |
442 | prepared to generate wakeup events. | 457 | prepared to generate wakeup events. |
443 | 458 | ||
444 | 3. The freeze_noirq phase is analogous to the suspend_noirq phase discussed | 459 | 3. The freeze_late phase is analogous to the suspend_late phase described |
460 | above, except that the device should not be put in a low-power state and | ||
461 | should not be allowed to generate wakeup events by it. | ||
462 | |||
463 | 4. The freeze_noirq phase is analogous to the suspend_noirq phase discussed | ||
445 | above, except again that the device should not be put in a low-power | 464 | above, except again that the device should not be put in a low-power |
446 | state and should not be allowed to generate wakeup events. | 465 | state and should not be allowed to generate wakeup events. |
447 | 466 | ||
@@ -449,15 +468,19 @@ At this point the system image is created. All devices should be inactive and | |||
449 | the contents of memory should remain undisturbed while this happens, so that the | 468 | the contents of memory should remain undisturbed while this happens, so that the |
450 | image forms an atomic snapshot of the system state. | 469 | image forms an atomic snapshot of the system state. |
451 | 470 | ||
452 | 4. The thaw_noirq phase is analogous to the resume_noirq phase discussed | 471 | 5. The thaw_noirq phase is analogous to the resume_noirq phase discussed |
453 | above. The main difference is that its methods can assume the device is | 472 | above. The main difference is that its methods can assume the device is |
454 | in the same state as at the end of the freeze_noirq phase. | 473 | in the same state as at the end of the freeze_noirq phase. |
455 | 474 | ||
456 | 5. The thaw phase is analogous to the resume phase discussed above. Its | 475 | 6. The thaw_early phase is analogous to the resume_early phase described |
476 | above. Its methods should undo the actions of the preceding | ||
477 | freeze_late, if necessary. | ||
478 | |||
479 | 7. The thaw phase is analogous to the resume phase discussed above. Its | ||
457 | methods should bring the device back to an operating state, so that it | 480 | methods should bring the device back to an operating state, so that it |
458 | can be used for saving the image if necessary. | 481 | can be used for saving the image if necessary. |
459 | 482 | ||
460 | 6. The complete phase is discussed in the "Leaving System Suspend" section | 483 | 8. The complete phase is discussed in the "Leaving System Suspend" section |
461 | above. | 484 | above. |
462 | 485 | ||
463 | At this point the system image is saved, and the devices then need to be | 486 | At this point the system image is saved, and the devices then need to be |
@@ -465,16 +488,19 @@ prepared for the upcoming system shutdown. This is much like suspending them | |||
465 | before putting the system into the standby or memory sleep state, and the phases | 488 | before putting the system into the standby or memory sleep state, and the phases |
466 | are similar. | 489 | are similar. |
467 | 490 | ||
468 | 7. The prepare phase is discussed above. | 491 | 9. The prepare phase is discussed above. |
492 | |||
493 | 10. The poweroff phase is analogous to the suspend phase. | ||
469 | 494 | ||
470 | 8. The poweroff phase is analogous to the suspend phase. | 495 | 11. The poweroff_late phase is analogous to the suspend_late phase. |
471 | 496 | ||
472 | 9. The poweroff_noirq phase is analogous to the suspend_noirq phase. | 497 | 12. The poweroff_noirq phase is analogous to the suspend_noirq phase. |
473 | 498 | ||
474 | The poweroff and poweroff_noirq callbacks should do essentially the same things | 499 | The poweroff, poweroff_late and poweroff_noirq callbacks should do essentially |
475 | as the suspend and suspend_noirq callbacks. The only notable difference is that | 500 | the same things as the suspend, suspend_late and suspend_noirq callbacks, |
476 | they need not store the device register values, because the registers should | 501 | respectively. The only notable difference is that they need not store the |
477 | already have been stored during the freeze or freeze_noirq phases. | 502 | device register values, because the registers should already have been stored |
503 | during the freeze, freeze_late or freeze_noirq phases. | ||
478 | 504 | ||
479 | 505 | ||
480 | Leaving Hibernation | 506 | Leaving Hibernation |
@@ -518,22 +544,25 @@ To achieve this, the image kernel must restore the devices' pre-hibernation | |||
518 | functionality. The operation is much like waking up from the memory sleep | 544 | functionality. The operation is much like waking up from the memory sleep |
519 | state, although it involves different phases: | 545 | state, although it involves different phases: |
520 | 546 | ||
521 | restore_noirq, restore, complete | 547 | restore_noirq, restore_early, restore, complete |
522 | 548 | ||
523 | 1. The restore_noirq phase is analogous to the resume_noirq phase. | 549 | 1. The restore_noirq phase is analogous to the resume_noirq phase. |
524 | 550 | ||
525 | 2. The restore phase is analogous to the resume phase. | 551 | 2. The restore_early phase is analogous to the resume_early phase. |
552 | |||
553 | 3. The restore phase is analogous to the resume phase. | ||
526 | 554 | ||
527 | 3. The complete phase is discussed above. | 555 | 4. The complete phase is discussed above. |
528 | 556 | ||
529 | The main difference from resume[_noirq] is that restore[_noirq] must assume the | 557 | The main difference from resume[_early|_noirq] is that restore[_early|_noirq] |
530 | device has been accessed and reconfigured by the boot loader or the boot kernel. | 558 | must assume the device has been accessed and reconfigured by the boot loader or |
531 | Consequently the state of the device may be different from the state remembered | 559 | the boot kernel. Consequently the state of the device may be different from the |
532 | from the freeze and freeze_noirq phases. The device may even need to be reset | 560 | state remembered from the freeze, freeze_late and freeze_noirq phases. The |
533 | and completely re-initialized. In many cases this difference doesn't matter, so | 561 | device may even need to be reset and completely re-initialized. In many cases |
534 | the resume[_noirq] and restore[_norq] method pointers can be set to the same | 562 | this difference doesn't matter, so the resume[_early|_noirq] and |
535 | routines. Nevertheless, different callback pointers are used in case there is a | 563 | restore[_early|_norq] method pointers can be set to the same routines. |
536 | situation where it actually matters. | 564 | Nevertheless, different callback pointers are used in case there is a situation |
565 | where it actually does matter. | ||
537 | 566 | ||
538 | 567 | ||
539 | Device Power Management Domains | 568 | Device Power Management Domains |
diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt index ebd7490ef1df..ec715cd78fbb 100644 --- a/Documentation/power/freezing-of-tasks.txt +++ b/Documentation/power/freezing-of-tasks.txt | |||
@@ -63,6 +63,27 @@ devices have been reinitialized, the function thaw_processes() is called in | |||
63 | order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that | 63 | order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that |
64 | have been frozen leave __refrigerator() and continue running. | 64 | have been frozen leave __refrigerator() and continue running. |
65 | 65 | ||
66 | |||
67 | Rationale behind the functions dealing with freezing and thawing of tasks: | ||
68 | ------------------------------------------------------------------------- | ||
69 | |||
70 | freeze_processes(): | ||
71 | - freezes only userspace tasks | ||
72 | |||
73 | freeze_kernel_threads(): | ||
74 | - freezes all tasks (including kernel threads) because we can't freeze | ||
75 | kernel threads without freezing userspace tasks | ||
76 | |||
77 | thaw_kernel_threads(): | ||
78 | - thaws only kernel threads; this is particularly useful if we need to do | ||
79 | anything special in between thawing of kernel threads and thawing of | ||
80 | userspace tasks, or if we want to postpone the thawing of userspace tasks | ||
81 | |||
82 | thaw_processes(): | ||
83 | - thaws all tasks (including kernel threads) because we can't thaw userspace | ||
84 | tasks without thawing kernel threads | ||
85 | |||
86 | |||
66 | III. Which kernel threads are freezable? | 87 | III. Which kernel threads are freezable? |
67 | 88 | ||
68 | Kernel threads are not freezable by default. However, a kernel thread may clear | 89 | Kernel threads are not freezable by default. However, a kernel thread may clear |