|
@@ -105,11 +105,27 @@ static struct pm_qos_object network_throughput_pm_qos = {
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
+static BLOCKING_NOTIFIER_HEAD(memory_bandwidth_notifier);
|
|
|
|
+static struct pm_qos_constraints memory_bw_constraints = {
|
|
|
|
+ .list = PLIST_HEAD_INIT(memory_bw_constraints.list),
|
|
|
|
+ .target_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE,
|
|
|
|
+ .default_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE,
|
|
|
|
+ .no_constraint_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE,
|
|
|
|
+ .type = PM_QOS_SUM,
|
|
|
|
+ .notifiers = &memory_bandwidth_notifier,
|
|
|
|
+};
|
|
|
|
+static struct pm_qos_object memory_bandwidth_pm_qos = {
|
|
|
|
+ .constraints = &memory_bw_constraints,
|
|
|
|
+ .name = "memory_bandwidth",
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
static struct pm_qos_object *pm_qos_array[] = {
|
|
static struct pm_qos_object *pm_qos_array[] = {
|
|
&null_pm_qos,
|
|
&null_pm_qos,
|
|
&cpu_dma_pm_qos,
|
|
&cpu_dma_pm_qos,
|
|
&network_lat_pm_qos,
|
|
&network_lat_pm_qos,
|
|
- &network_throughput_pm_qos
|
|
|
|
|
|
+ &network_throughput_pm_qos,
|
|
|
|
+ &memory_bandwidth_pm_qos,
|
|
};
|
|
};
|
|
|
|
|
|
static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
|
|
static 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 = {
|
|
/* unlocked internal variant */
|
|
/* unlocked internal variant */
|
|
static inline int pm_qos_get_value(struct pm_qos_constraints *c)
|
|
static inline int pm_qos_get_value(struct pm_qos_constraints *c)
|
|
{
|
|
{
|
|
|
|
+ struct plist_node *node;
|
|
|
|
+ int total_value = 0;
|
|
|
|
+
|
|
if (plist_head_empty(&c->list))
|
|
if (plist_head_empty(&c->list))
|
|
return c->no_constraint_value;
|
|
return c->no_constraint_value;
|
|
|
|
|
|
@@ -140,6 +159,12 @@ static inline int pm_qos_get_value(struct pm_qos_constraints *c)
|
|
case PM_QOS_MAX:
|
|
case PM_QOS_MAX:
|
|
return plist_last(&c->list)->prio;
|
|
return plist_last(&c->list)->prio;
|
|
|
|
|
|
|
|
+ case PM_QOS_SUM:
|
|
|
|
+ plist_for_each(node, &c->list)
|
|
|
|
+ total_value += node->prio;
|
|
|
|
+
|
|
|
|
+ return total_value;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
/* runtime check for not using enum */
|
|
/* runtime check for not using enum */
|
|
BUG();
|
|
BUG();
|