aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-10 18:35:38 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-10 18:35:38 -0500
commit2d984ad132a87ca2112f81f21039493176a8bca0 (patch)
tree5bcec9039870a698baf6febef19742c1c3622d50 /Documentation/power
parent327adaedf2218b0e318eb393aa79cf2be64c199f (diff)
PM / QoS: Introcuce latency tolerance device PM QoS type
Add a new latency tolerance device PM QoS type to be use for specifying active state (RPM_ACTIVE) memory access (DMA) latency tolerance requirements for devices. It may be used to prevent hardware from choosing overly aggressive energy-saving operation modes (causing too much latency to appear) for the whole platform. This feature reqiures hardware support, so it only will be available for devices having a new .set_latency_tolerance() callback in struct dev_pm_info populated, in which case the routine pointed to by it should implement whatever is necessary to transfer the effective requirement value to the hardware. Whenever the effective latency tolerance changes for the device, its .set_latency_tolerance() callback will be executed and the effective value will be passed to it. If that value is negative, which means that the list of latency tolerance requirements for the device is empty, the callback is expected to switch the underlying hardware latency tolerance control mechanism to an autonomous mode if available. If that value is PM_QOS_LATENCY_ANY, in turn, and the hardware supports a special "no requirement" setting, the callback is expected to use it. That allows software to prevent the hardware from automatically updating the device's latency tolerance in response to its power state changes (e.g. during transitions from D3cold to D0), which generally may be done in the autonomous latency tolerance control mode. If .set_latency_tolerance() is present for the device, a new pm_qos_latency_tolerance_us attribute will be present in the devivce's power directory in sysfs. Then, user space can use that attribute to specify its latency tolerance requirement for the device, if any. Writing "any" to it means "no requirement, but do not let the hardware control latency tolerance" and writing "auto" to it allows the hardware to be switched to the autonomous mode if there are no other requirements from the kernel side in the device's list. This changeset includes a fix from Mika Westerberg. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/pm_qos_interface.txt59
1 files changed, 50 insertions, 9 deletions
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt
index 22cb8f51182a..ed743bbad87c 100644
--- a/Documentation/power/pm_qos_interface.txt
+++ b/Documentation/power/pm_qos_interface.txt
@@ -88,17 +88,19 @@ node.
88 88
892. PM QoS per-device latency and flags framework 892. PM QoS per-device latency and flags framework
90 90
91For each device, there are two lists of PM QoS requests. One is maintained 91For each device, there are three lists of PM QoS requests. Two of them are
92along with the aggregated target of resume latency value and the other is for 92maintained along with the aggregated targets of resume latency and active
93PM QoS flags. Values are updated in response to changes of the request list. 93state latency tolerance (in microseconds) and the third one is for PM QoS flags.
94Values are updated in response to changes of the request list.
94 95
95Target resume latency value is simply the minimum of the request values held in 96The target values of resume latency and active state latency tolerance are
96the parameter list elements. The PM QoS flags aggregate value is a gather 97simply the minimum of the request values held in the parameter list elements.
97(bitwise OR) of all list elements' values. Two device PM QoS flags are defined 98The PM QoS flags aggregate value is a gather (bitwise OR) of all list elements'
98currently: PM_QOS_FLAG_NO_POWER_OFF and PM_QOS_FLAG_REMOTE_WAKEUP. 99values. Two device PM QoS flags are defined currently: PM_QOS_FLAG_NO_POWER_OFF
100and PM_QOS_FLAG_REMOTE_WAKEUP.
99 101
100Note: the aggregated target value is implemented in such a way that reading the 102Note: The aggregated target values are implemented in such a way that reading
101aggregated value does not require any locking mechanism. 103the aggregated value does not require any locking mechanism.
102 104
103 105
104From kernel mode the use of this interface is the following: 106From kernel mode the use of this interface is the following:
@@ -177,3 +179,42 @@ The callback is called when the aggregated value for any device is changed
177int dev_pm_qos_remove_global_notifier(notifier): 179int dev_pm_qos_remove_global_notifier(notifier):
178Removes the notification callback function from the global notification tree 180Removes the notification callback function from the global notification tree
179of the framework. 181of the framework.
182
183
184Active state latency tolerance
185
186This device PM QoS type is used to support systems in which hardware may switch
187to energy-saving operation modes on the fly. In those systems, if the operation
188mode chosen by the hardware attempts to save energy in an overly aggressive way,
189it may cause excess latencies to be visible to software, causing it to miss
190certain protocol requirements or target frame or sample rates etc.
191
192If there is a latency tolerance control mechanism for a given device available
193to software, the .set_latency_tolerance callback in that device's dev_pm_info
194structure should be populated. The routine pointed to by it is should implement
195whatever is necessary to transfer the effective requirement value to the
196hardware.
197
198Whenever the effective latency tolerance changes for the device, its
199.set_latency_tolerance() callback will be executed and the effective value will
200be passed to it. If that value is negative, which means that the list of
201latency tolerance requirements for the device is empty, the callback is expected
202to switch the underlying hardware latency tolerance control mechanism to an
203autonomous mode if available. If that value is PM_QOS_LATENCY_ANY, in turn, and
204the hardware supports a special "no requirement" setting, the callback is
205expected to use it. That allows software to prevent the hardware from
206automatically updating the device's latency tolerance in response to its power
207state changes (e.g. during transitions from D3cold to D0), which generally may
208be done in the autonomous latency tolerance control mode.
209
210If .set_latency_tolerance() is present for the device, sysfs attribute
211pm_qos_latency_tolerance_us will be present in the devivce's power directory.
212Then, user space can use that attribute to specify its latency tolerance
213requirement for the device, if any. Writing "any" to it means "no requirement,
214but do not let the hardware control latency tolerance" and writing "auto" to it
215allows the hardware to be switched to the autonomous mode if there are no other
216requirements from the kernel side in the device's list.
217
218Kernel code can use the functions described above along with the
219DEV_PM_QOS_LATENCY_TOLERANCE device PM QoS type to add, remove and update
220latency tolerance requirements for devices.