PM / QoS: Add PM_QOS_FORCE_MAX type
authorJongpill Lee <boyko.lee@samsung.com>
Thu, 4 Oct 2012 07:40:57 +0000 (16:40 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:08:57 +0000 (17:08 +0900)
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 <boyko.lee@samsung.com>
Signed-off-by: Sungjinn Chung <sungjinn.chung@samsung.com>
Conflicts:

include/linux/pm_qos.h
kernel/power/qos.c

Change-Id: I11a6812d3f67a4b03d561063243661f4302b35f3

include/linux/pm_qos.h
kernel/power/qos.c

index dfef3afeec33152975a91786f5c92b24c5253dde..2b6db0abe70a4585ea2ca52937c926d26680286a 100644 (file)
@@ -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,
 };
 
 /*
index ea5617f83657bcb9e180d636a497458328b4fe8a..b5c010b6db50ce1bce3f109debc6dbdf0fabde36 100644 (file)
@@ -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)