summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDeepthy Ravi <deepthy.ravi@ti.com>2012-02-22 22:50:14 +0800
committerAndy Green <andy.green@linaro.org>2012-06-22 09:22:44 +0800
commit1e40eeb34784eac74962d4b1869254138d90301c (patch)
treeb03d59a1dc9e0cab044b11cd11fa621e14dc89f0 /kernel
parentdd844ffd287cb72f1728d5452747fda3a47f2abb (diff)
PM QoS: Modify the aggregate value of memory throughput constraint class
This patch modifies the memory throughput constraint class to give the aggregate value as the sum of all the bandwidth requests. Earlier it was the maximum value. Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/qos.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 4f163fae510c..336a251340d0 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -91,7 +91,7 @@ static struct pm_qos_constraints memory_tput_constraints = {
.list = PLIST_HEAD_INIT(memory_tput_constraints.list),
.target_value = PM_QOS_MEMORY_THROUGHPUT_DEFAULT_VALUE,
.default_value = PM_QOS_MEMORY_THROUGHPUT_DEFAULT_VALUE,
- .type = PM_QOS_MAX,
+ .type = PM_QOS_ADD,
.notifiers = &memory_throughput_notifier,
};
static struct pm_qos_object memory_throughput_pm_qos = {
@@ -139,6 +139,9 @@ static const struct file_operations pm_qos_power_fops = {
/* unlocked internal variant */
static inline int pm_qos_get_value(struct pm_qos_constraints *c)
{
+ int sum = 0;
+ struct pm_qos_request *req;
+
if (plist_head_empty(&c->list))
return c->default_value;
@@ -149,6 +152,10 @@ static inline int pm_qos_get_value(struct pm_qos_constraints *c)
case PM_QOS_MAX:
return plist_last(&c->list)->prio;
+ case PM_QOS_ADD:
+ plist_for_each_entry(req, &c->list, node)
+ sum += (req->node).prio;
+ return sum;
default:
/* runtime check for not using enum */
BUG();