From dc84336b0c78d20bc57bfefc03d835cc760b240f Mon Sep 17 00:00:00 2001 From: Jongpill Lee Date: Thu, 4 Oct 2012 16:40:57 +0900 Subject: [PATCH] PM / QoS: Add PM_QOS_FORCE_MAX type This patch adds PM_QOS_FORCE_MAX type for pm_qos type. If use PM_QOS_FORCE_MAX type for each pm_qos_constraints struct, Will be updated qos unconditionally. Signed-off-by: Jongpill Lee Signed-off-by: Sungjinn Chung Conflicts: include/linux/pm_qos.h kernel/power/qos.c Change-Id: I11a6812d3f67a4b03d561063243661f4302b35f3 --- include/linux/pm_qos.h | 3 ++- kernel/power/qos.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index dfef3afeec33..2b6db0abe70a 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -76,7 +76,8 @@ enum pm_qos_type { PM_QOS_UNITIALIZED, PM_QOS_MAX, /* return the largest value */ PM_QOS_MIN, /* return the smallest value */ - PM_QOS_SUM /* return the sum */ + PM_QOS_SUM, /* return sum of values greater than zero */ + PM_QOS_FORCE_MAX, }; /* diff --git a/kernel/power/qos.c b/kernel/power/qos.c index ea5617f83657..b5c010b6db50 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -187,6 +187,7 @@ static inline int pm_qos_get_value(struct pm_qos_constraints *c) return plist_first(&c->list)->prio; case PM_QOS_MAX: + case PM_QOS_FORCE_MAX: return plist_last(&c->list)->prio; case PM_QOS_SUM: @@ -338,6 +339,14 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, spin_unlock_irqrestore(&pm_qos_lock, flags); trace_pm_qos_update_target(action, prev_value, curr_value); + + if (c->type == PM_QOS_FORCE_MAX) { + blocking_notifier_call_chain(c->notifiers, + (unsigned long)curr_value, + NULL); + return 1; + } + if (prev_value != curr_value) { ret = 1; if (c->notifiers) -- 2.20.1