Commit 455716e9 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
parent c47586b6
...@@ -604,7 +604,7 @@ state temporarily, for example so that its system wakeup capability can be ...@@ -604,7 +604,7 @@ state temporarily, for example so that its system wakeup capability can be
disabled. This all depends on the hardware and the design of the subsystem and disabled. This all depends on the hardware and the design of the subsystem and
device driver in question. device driver in question.
During system-wide resume from a sleep state it's best to put devices into the During system-wide resume from a sleep state it's easiest to put devices into
full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to the full-power state, as explained in Documentation/power/runtime_pm.txt. Refer
that document for more information regarding this particular issue as well as to that document for more information regarding this particular issue as well as
for information on the device runtime power management framework in general. for information on the device runtime power management framework in general.
...@@ -553,9 +553,9 @@ suspend routine). It may be necessary to resume the device and suspend it again ...@@ -553,9 +553,9 @@ suspend routine). It may be necessary to resume the device and suspend it again
in order to do so. The same is true if the driver uses different power levels in order to do so. The same is true if the driver uses different power levels
or other settings for run-time suspend and system sleep. or other settings for run-time suspend and system sleep.
During system resume, devices generally should be brought back to full power, During system resume, the simplest approach is to bring all devices back to full
even if they were suspended before the system sleep began. There are several power, even if they had been suspended before the system suspend began. There
reasons for this, including: are several reasons for this, including:
* The device might need to switch power levels, wake-up settings, etc. * The device might need to switch power levels, wake-up settings, etc.
...@@ -572,16 +572,27 @@ reasons for this, including: ...@@ -572,16 +572,27 @@ reasons for this, including:
* Even though the device was suspended, if its usage counter was > 0 then most * Even though the device was suspended, if its usage counter was > 0 then most
likely it would need a run-time resume in the near future anyway. likely it would need a run-time resume in the near future anyway.
* Always going back to full power is simplest. If the device had been suspended before the system suspend began and it's
brought back to full power during resume, then its run-time PM status will have
If the device was suspended before the sleep began, then its run-time PM status to be updated to reflect the actual post-system sleep status. The way to do
will have to be updated to reflect the actual post-system sleep status. The way this is:
to do this is:
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_active(dev); pm_runtime_set_active(dev);
pm_runtime_enable(dev); pm_runtime_enable(dev);
On some systems, however, system sleep is not entered through a global firmware
or hardware operation. Instead, all hardware components are put into low-power
states directly by the kernel in a coordinated way. Then, the system sleep
state effectively follows from the states the hardware components end up in
and the system is woken up from that state by a hardware interrupt or a similar
mechanism entirely under the kernel's control. As a result, the kernel never
gives control away and the states of all devices during resume are precisely
known to it. If that is the case and none of the situations listed above takes
place (in particular, if the system is not waking up from hibernation), it may
be more efficient to leave the devices that had been suspended before the system
suspend began in the suspended state.
7. Generic subsystem callbacks 7. Generic subsystem callbacks
Subsystems may wish to conserve code space by using the set of generic power Subsystems may wish to conserve code space by using the set of generic power
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment