aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/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 /kernel/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 'kernel/power')
-rw-r--r--kernel/power/qos.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index e23ae38e647f..884b77058864 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -173,6 +173,7 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
173{ 173{
174 unsigned long flags; 174 unsigned long flags;
175 int prev_value, curr_value, new_value; 175 int prev_value, curr_value, new_value;
176 int ret;
176 177
177 spin_lock_irqsave(&pm_qos_lock, flags); 178 spin_lock_irqsave(&pm_qos_lock, flags);
178 prev_value = pm_qos_get_value(c); 179 prev_value = pm_qos_get_value(c);
@@ -208,13 +209,15 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
208 209
209 trace_pm_qos_update_target(action, prev_value, curr_value); 210 trace_pm_qos_update_target(action, prev_value, curr_value);
210 if (prev_value != curr_value) { 211 if (prev_value != curr_value) {
211 blocking_notifier_call_chain(c->notifiers, 212 ret = 1;
212 (unsigned long)curr_value, 213 if (c->notifiers)
213 NULL); 214 blocking_notifier_call_chain(c->notifiers,
214 return 1; 215 (unsigned long)curr_value,
216 NULL);
215 } else { 217 } else {
216 return 0; 218 ret = 0;
217 } 219 }
220 return ret;
218} 221}
219 222
220/** 223/**