diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-01 16:29:05 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-02 08:30:09 -0400 |
commit | 455716e9b12ba93e93181ac88bef62e4eb5ac66c (patch) | |
tree | 8a203f3f4a7a76db1c274c1c18c49508a6704758 /Documentation | |
parent | c47586b6d36ef2d5d7dc39afc44b75e31bc1a671 (diff) |
PM / Runtime: Update documentation of interactions with system sleep
The documents describing the interactions between runtime PM and
system sleep generally refer to the model in which the system sleep
state is entered through a global firmware or hardware operation.
As a result, some recommendations given in there are not entirely
suitable for systems in which this is not the case. Update the
documentation to take the existence of those systems into account.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/power/devices.txt | 6 | ||||
-rw-r--r-- | Documentation/power/runtime_pm.txt | 27 |
2 files changed, 22 insertions, 11 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 85c6f980b642..3384d5996be2 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -604,7 +604,7 @@ state temporarily, for example so that its system wakeup capability can be | |||
604 | disabled. This all depends on the hardware and the design of the subsystem and | 604 | disabled. This all depends on the hardware and the design of the subsystem and |
605 | device driver in question. | 605 | device driver in question. |
606 | 606 | ||
607 | During system-wide resume from a sleep state it's best to put devices into the | 607 | During system-wide resume from a sleep state it's easiest to put devices into |
608 | full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to | 608 | the full-power state, as explained in Documentation/power/runtime_pm.txt. Refer |
609 | that document for more information regarding this particular issue as well as | 609 | to that document for more information regarding this particular issue as well as |
610 | for information on the device runtime power management framework in general. | 610 | for information on the device runtime power management framework in general. |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 4b011b171be4..513c52ef5a42 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -553,9 +553,9 @@ suspend routine). It may be necessary to resume the device and suspend it again | |||
553 | in order to do so. The same is true if the driver uses different power levels | 553 | in order to do so. The same is true if the driver uses different power levels |
554 | or other settings for run-time suspend and system sleep. | 554 | or other settings for run-time suspend and system sleep. |
555 | 555 | ||
556 | During system resume, devices generally should be brought back to full power, | 556 | During system resume, the simplest approach is to bring all devices back to full |
557 | even if they were suspended before the system sleep began. There are several | 557 | power, even if they had been suspended before the system suspend began. There |
558 | reasons for this, including: | 558 | are several reasons for this, including: |
559 | 559 | ||
560 | * The device might need to switch power levels, wake-up settings, etc. | 560 | * The device might need to switch power levels, wake-up settings, etc. |
561 | 561 | ||
@@ -572,16 +572,27 @@ reasons for this, including: | |||
572 | * Even though the device was suspended, if its usage counter was > 0 then most | 572 | * Even though the device was suspended, if its usage counter was > 0 then most |
573 | likely it would need a run-time resume in the near future anyway. | 573 | likely it would need a run-time resume in the near future anyway. |
574 | 574 | ||
575 | * Always going back to full power is simplest. | 575 | If the device had been suspended before the system suspend began and it's |
576 | 576 | brought back to full power during resume, then its run-time PM status will have | |
577 | If the device was suspended before the sleep began, then its run-time PM status | 577 | to be updated to reflect the actual post-system sleep status. The way to do |
578 | will have to be updated to reflect the actual post-system sleep status. The way | 578 | this is: |
579 | to do this is: | ||
580 | 579 | ||
581 | pm_runtime_disable(dev); | 580 | pm_runtime_disable(dev); |
582 | pm_runtime_set_active(dev); | 581 | pm_runtime_set_active(dev); |
583 | pm_runtime_enable(dev); | 582 | pm_runtime_enable(dev); |
584 | 583 | ||
584 | On some systems, however, system sleep is not entered through a global firmware | ||
585 | or hardware operation. Instead, all hardware components are put into low-power | ||
586 | states directly by the kernel in a coordinated way. Then, the system sleep | ||
587 | state effectively follows from the states the hardware components end up in | ||
588 | and the system is woken up from that state by a hardware interrupt or a similar | ||
589 | mechanism entirely under the kernel's control. As a result, the kernel never | ||
590 | gives control away and the states of all devices during resume are precisely | ||
591 | known to it. If that is the case and none of the situations listed above takes | ||
592 | place (in particular, if the system is not waking up from hibernation), it may | ||
593 | be more efficient to leave the devices that had been suspended before the system | ||
594 | suspend began in the suspended state. | ||
595 | |||
585 | 7. Generic subsystem callbacks | 596 | 7. Generic subsystem callbacks |
586 | 597 | ||
587 | Subsystems may wish to conserve code space by using the set of generic power | 598 | Subsystems may wish to conserve code space by using the set of generic power |