diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-15 20:47:37 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-16 17:15:44 -0400 |
commit | f71495f3f0c5f0801823d1235b271a4a415d3df8 (patch) | |
tree | 6aa0d71ea6ed2ddaccbff462daa325c8fd56741f /Documentation/power/devices.txt | |
parent | aae4518b3124b29f8dc81c829c704fd2df72e98b (diff) |
PM / sleep: Update device PM documentation to cover direct_complete
Update the device PM documentation in devices.txt and runtime_pm.txt
to reflect the changes in the system suspend and resume handling
related to the introduction of the new power.direct_complete flag.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Diffstat (limited to 'Documentation/power/devices.txt')
-rw-r--r-- | Documentation/power/devices.txt | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 47d46dff70f7..d172bce0fd49 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -2,6 +2,7 @@ Device Power Management | |||
2 | 2 | ||
3 | Copyright (c) 2010-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | 3 | Copyright (c) 2010-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. |
4 | Copyright (c) 2010 Alan Stern <stern@rowland.harvard.edu> | 4 | Copyright (c) 2010 Alan Stern <stern@rowland.harvard.edu> |
5 | Copyright (c) 2014 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
5 | 6 | ||
6 | 7 | ||
7 | Most of the code in Linux is device drivers, so most of the Linux power | 8 | Most of the code in Linux is device drivers, so most of the Linux power |
@@ -326,6 +327,20 @@ the phases are: | |||
326 | driver in some way for the upcoming system power transition, but it | 327 | driver in some way for the upcoming system power transition, but it |
327 | should not put the device into a low-power state. | 328 | should not put the device into a low-power state. |
328 | 329 | ||
330 | For devices supporting runtime power management, the return value of the | ||
331 | prepare callback can be used to indicate to the PM core that it may | ||
332 | safely leave the device in runtime suspend (if runtime-suspended | ||
333 | already), provided that all of the device's descendants are also left in | ||
334 | runtime suspend. Namely, if the prepare callback returns a positive | ||
335 | number and that happens for all of the descendants of the device too, | ||
336 | and all of them (including the device itself) are runtime-suspended, the | ||
337 | PM core will skip the suspend, suspend_late and suspend_noirq suspend | ||
338 | phases as well as the resume_noirq, resume_early and resume phases of | ||
339 | the following system resume for all of these devices. In that case, | ||
340 | the complete callback will be called directly after the prepare callback | ||
341 | and is entirely responsible for bringing the device back to the | ||
342 | functional state as appropriate. | ||
343 | |||
329 | 2. The suspend methods should quiesce the device to stop it from performing | 344 | 2. The suspend methods should quiesce the device to stop it from performing |
330 | I/O. They also may save the device registers and put it into the | 345 | I/O. They also may save the device registers and put it into the |
331 | appropriate low-power state, depending on the bus type the device is on, | 346 | appropriate low-power state, depending on the bus type the device is on, |
@@ -400,12 +415,23 @@ When resuming from freeze, standby or memory sleep, the phases are: | |||
400 | the resume callbacks occur; it's not necessary to wait until the | 415 | the resume callbacks occur; it's not necessary to wait until the |
401 | complete phase. | 416 | complete phase. |
402 | 417 | ||
418 | Moreover, if the preceding prepare callback returned a positive number, | ||
419 | the device may have been left in runtime suspend throughout the whole | ||
420 | system suspend and resume (the suspend, suspend_late, suspend_noirq | ||
421 | phases of system suspend and the resume_noirq, resume_early, resume | ||
422 | phases of system resume may have been skipped for it). In that case, | ||
423 | the complete callback is entirely responsible for bringing the device | ||
424 | back to the functional state after system suspend if necessary. [For | ||
425 | example, it may need to queue up a runtime resume request for the device | ||
426 | for this purpose.] To check if that is the case, the complete callback | ||
427 | can consult the device's power.direct_complete flag. Namely, if that | ||
428 | flag is set when the complete callback is being run, it has been called | ||
429 | directly after the preceding prepare and special action may be required | ||
430 | to make the device work correctly afterward. | ||
431 | |||
403 | At the end of these phases, drivers should be as functional as they were before | 432 | At the end of these phases, drivers should be as functional as they were before |
404 | suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are | 433 | suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are |
405 | gated on. Even if the device was in a low-power state before the system sleep | 434 | gated on. |
406 | because of runtime power management, afterwards it should be back in its | ||
407 | full-power state. There are multiple reasons why it's best to do this; they are | ||
408 | discussed in more detail in Documentation/power/runtime_pm.txt. | ||
409 | 435 | ||
410 | However, the details here may again be platform-specific. For example, | 436 | However, the details here may again be platform-specific. For example, |
411 | some systems support multiple "run" states, and the mode in effect at | 437 | some systems support multiple "run" states, and the mode in effect at |