aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-28 07:01:40 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-28 07:01:40 -0400
commite52cff8bdd4a30c40a7f65c7ea8f1f425f8a15eb (patch)
tree1729332ebab51bb560ca64effe46cdab38ab537f /Documentation/power
parent405a1086bdd091d2d55db0ac905cd6332b35cec1 (diff)
parentf5ce1572109049b90484e2bb44927cb6034c5eb1 (diff)
Merge branch 'pm-assorted'
* pm-assorted: PM / QoS: Add pm_qos and dev_pm_qos to events-power.txt PM / QoS: Add dev_pm_qos_request tracepoints PM / QoS: Add pm_qos_request tracepoints PM / QoS: Add pm_qos_update_target/flags tracepoints PM / QoS: Update Documentation/power/pm_qos_interface.txt PM / Sleep: Print last wakeup source on failed wakeup_count write PM / QoS: correct the valid range of pm_qos_class PM / wakeup: Adjust messaging for wake events during suspend PM / Runtime: Update .runtime_idle() callback documentation PM / Runtime: Rework the "runtime idle" helper routine PM / Hibernate: print physical addresses consistently with other parts of kernel
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/pm_qos_interface.txt50
-rw-r--r--Documentation/power/runtime_pm.txt20
2 files changed, 53 insertions, 17 deletions
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt
index 79a2a58425ee..483632087788 100644
--- a/Documentation/power/pm_qos_interface.txt
+++ b/Documentation/power/pm_qos_interface.txt
@@ -7,7 +7,7 @@ one of the parameters.
7Two different PM QoS frameworks are available: 7Two different PM QoS frameworks are available:
81. PM QoS classes for cpu_dma_latency, network_latency, network_throughput. 81. PM QoS classes for cpu_dma_latency, network_latency, network_throughput.
92. the per-device PM QoS framework provides the API to manage the per-device latency 92. the per-device PM QoS framework provides the API to manage the per-device latency
10constraints. 10constraints and PM QoS flags.
11 11
12Each parameters have defined units: 12Each parameters have defined units:
13 * latency: usec 13 * latency: usec
@@ -86,13 +86,17 @@ To remove the user mode request for a target value simply close the device
86node. 86node.
87 87
88 88
892. PM QoS per-device latency framework 892. PM QoS per-device latency and flags framework
90
91For each device, there are two lists of PM QoS requests. One is maintained
92along with the aggregated target of latency value and the other is for PM QoS
93flags. Values are updated in response to changes of the request list.
94
95Target latency value is simply the minimum of the request values held in the
96parameter list elements. The PM QoS flags aggregate value is a gather (bitwise
97OR) of all list elements' values. Two device PM QoS flags are defined currently:
98PM_QOS_FLAG_NO_POWER_OFF and PM_QOS_FLAG_REMOTE_WAKEUP.
90 99
91For each device a list of performance requests is maintained along with
92an aggregated target value. The aggregated target value is updated with
93changes to the request list or elements of the list. Typically the
94aggregated target value is simply the max or min of the request values held
95in the parameter list elements.
96Note: the aggregated target value is implemented as an atomic variable so that 100Note: the aggregated target value is implemented as an atomic variable so that
97reading the aggregated value does not require any locking mechanism. 101reading the aggregated value does not require any locking mechanism.
98 102
@@ -119,6 +123,38 @@ the request.
119s32 dev_pm_qos_read_value(device): 123s32 dev_pm_qos_read_value(device):
120Returns the aggregated value for a given device's constraints list. 124Returns the aggregated value for a given device's constraints list.
121 125
126enum pm_qos_flags_status dev_pm_qos_flags(device, mask)
127Check PM QoS flags of the given device against the given mask of flags.
128The meaning of the return values is as follows:
129 PM_QOS_FLAGS_ALL: All flags from the mask are set
130 PM_QOS_FLAGS_SOME: Some flags from the mask are set
131 PM_QOS_FLAGS_NONE: No flags from the mask are set
132 PM_QOS_FLAGS_UNDEFINED: The device's PM QoS structure has not been
133 initialized or the list of requests is empty.
134
135int dev_pm_qos_add_ancestor_request(dev, handle, value)
136Add a PM QoS request for the first direct ancestor of the given device whose
137power.ignore_children flag is unset.
138
139int dev_pm_qos_expose_latency_limit(device, value)
140Add a request to the device's PM QoS list of latency constraints and create
141a sysfs attribute pm_qos_resume_latency_us under the device's power directory
142allowing user space to manipulate that request.
143
144void dev_pm_qos_hide_latency_limit(device)
145Drop the request added by dev_pm_qos_expose_latency_limit() from the device's
146PM QoS list of latency constraints and remove sysfs attribute pm_qos_resume_latency_us
147from the device's power directory.
148
149int dev_pm_qos_expose_flags(device, value)
150Add a request to the device's PM QoS list of flags and create sysfs attributes
151pm_qos_no_power_off and pm_qos_remote_wakeup under the device's power directory
152allowing user space to change these flags' value.
153
154void dev_pm_qos_hide_flags(device)
155Drop the request added by dev_pm_qos_expose_flags() from the device's PM QoS list
156of flags and remove sysfs attributes pm_qos_no_power_off and pm_qos_remote_wakeup
157under the device's power directory.
122 158
123Notification mechanisms: 159Notification mechanisms:
124The per-device PM QoS framework has 2 different and distinct notification trees: 160The per-device PM QoS framework has 2 different and distinct notification trees:
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 6c9f5d9aa115..71d8fe4e75d3 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -144,8 +144,12 @@ The action performed by the idle callback is totally dependent on the subsystem
144(or driver) in question, but the expected and recommended action is to check 144(or driver) in question, but the expected and recommended action is to check
145if the device can be suspended (i.e. if all of the conditions necessary for 145if the device can be suspended (i.e. if all of the conditions necessary for
146suspending the device are satisfied) and to queue up a suspend request for the 146suspending the device are satisfied) and to queue up a suspend request for the
147device in that case. The value returned by this callback is ignored by the PM 147device in that case. If there is no idle callback, or if the callback returns
148core. 1480, then the PM core will attempt to carry out a runtime suspend of the device;
149in essence, it will call pm_runtime_suspend() directly. To prevent this (for
150example, if the callback routine has started a delayed suspend), the routine
151should return a non-zero value. Negative error return codes are ignored by the
152PM core.
149 153
150The helper functions provided by the PM core, described in Section 4, guarantee 154The helper functions provided by the PM core, described in Section 4, guarantee
151that the following constraints are met with respect to runtime PM callbacks for 155that the following constraints are met with respect to runtime PM callbacks for
@@ -301,9 +305,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
301 removing the device from device hierarchy 305 removing the device from device hierarchy
302 306
303 int pm_runtime_idle(struct device *dev); 307 int pm_runtime_idle(struct device *dev);
304 - execute the subsystem-level idle callback for the device; returns 0 on 308 - execute the subsystem-level idle callback for the device; returns an
305 success or error code on failure, where -EINPROGRESS means that 309 error code on failure, where -EINPROGRESS means that ->runtime_idle() is
306 ->runtime_idle() is already being executed 310 already being executed; if there is no callback or the callback returns 0
311 then run pm_runtime_suspend(dev) and return its result
307 312
308 int pm_runtime_suspend(struct device *dev); 313 int pm_runtime_suspend(struct device *dev);
309 - execute the subsystem-level suspend callback for the device; returns 0 on 314 - execute the subsystem-level suspend callback for the device; returns 0 on
@@ -660,11 +665,6 @@ Subsystems may wish to conserve code space by using the set of generic power
660management callbacks provided by the PM core, defined in 665management callbacks provided by the PM core, defined in
661driver/base/power/generic_ops.c: 666driver/base/power/generic_ops.c:
662 667
663 int pm_generic_runtime_idle(struct device *dev);
664 - invoke the ->runtime_idle() callback provided by the driver of this
665 device, if defined, and call pm_runtime_suspend() for this device if the
666 return value is 0 or the callback is not defined
667
668 int pm_generic_runtime_suspend(struct device *dev); 668 int pm_generic_runtime_suspend(struct device *dev);
669 - invoke the ->runtime_suspend() callback provided by the driver of this 669 - invoke the ->runtime_suspend() callback provided by the driver of this
670 device and return its result, or return -EINVAL if not defined 670 device and return its result, or return -EINVAL if not defined