@@ -105,11 +105,27 @@ static struct pm_qos_object network_throughput_pm_qos = {
105105};
106106
107107
108+ static BLOCKING_NOTIFIER_HEAD (memory_bandwidth_notifier );
109+ static struct pm_qos_constraints memory_bw_constraints = {
110+ .list = PLIST_HEAD_INIT (memory_bw_constraints .list ),
111+ .target_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE ,
112+ .default_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE ,
113+ .no_constraint_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE ,
114+ .type = PM_QOS_SUM ,
115+ .notifiers = & memory_bandwidth_notifier ,
116+ };
117+ static struct pm_qos_object memory_bandwidth_pm_qos = {
118+ .constraints = & memory_bw_constraints ,
119+ .name = "memory_bandwidth" ,
120+ };
121+
122+
108123static struct pm_qos_object * pm_qos_array [] = {
109124 & null_pm_qos ,
110125 & cpu_dma_pm_qos ,
111126 & network_lat_pm_qos ,
112- & network_throughput_pm_qos
127+ & network_throughput_pm_qos ,
128+ & memory_bandwidth_pm_qos ,
113129};
114130
115131static ssize_t pm_qos_power_write (struct file * filp , const char __user * buf ,
@@ -130,6 +146,9 @@ static const struct file_operations pm_qos_power_fops = {
130146/* unlocked internal variant */
131147static inline int pm_qos_get_value (struct pm_qos_constraints * c )
132148{
149+ struct plist_node * node ;
150+ int total_value = 0 ;
151+
133152 if (plist_head_empty (& c -> list ))
134153 return c -> no_constraint_value ;
135154
@@ -140,6 +159,12 @@ static inline int pm_qos_get_value(struct pm_qos_constraints *c)
140159 case PM_QOS_MAX :
141160 return plist_last (& c -> list )-> prio ;
142161
162+ case PM_QOS_SUM :
163+ plist_for_each (node , & c -> list )
164+ total_value += node -> prio ;
165+
166+ return total_value ;
167+
143168 default :
144169 /* runtime check for not using enum */
145170 BUG ();
0 commit comments