diff options
Diffstat (limited to 'kernel/pm_qos_params.c')
-rw-r--r-- | kernel/pm_qos_params.c | 79 |
1 files changed, 62 insertions, 17 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index 6824ca7d4d0..82da7ac3b1f 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c | |||
@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(pm_qos_lock); | |||
74 | static struct pm_qos_object null_pm_qos; | 74 | static struct pm_qos_object null_pm_qos; |
75 | static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier); | 75 | static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier); |
76 | static struct pm_qos_object cpu_dma_pm_qos = { | 76 | static struct pm_qos_object cpu_dma_pm_qos = { |
77 | .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests, pm_qos_lock), | 77 | .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests), |
78 | .notifiers = &cpu_dma_lat_notifier, | 78 | .notifiers = &cpu_dma_lat_notifier, |
79 | .name = "cpu_dma_latency", | 79 | .name = "cpu_dma_latency", |
80 | .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE, | 80 | .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE, |
@@ -84,7 +84,7 @@ static struct pm_qos_object cpu_dma_pm_qos = { | |||
84 | 84 | ||
85 | static BLOCKING_NOTIFIER_HEAD(network_lat_notifier); | 85 | static BLOCKING_NOTIFIER_HEAD(network_lat_notifier); |
86 | static struct pm_qos_object network_lat_pm_qos = { | 86 | static struct pm_qos_object network_lat_pm_qos = { |
87 | .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests, pm_qos_lock), | 87 | .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests), |
88 | .notifiers = &network_lat_notifier, | 88 | .notifiers = &network_lat_notifier, |
89 | .name = "network_latency", | 89 | .name = "network_latency", |
90 | .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, | 90 | .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, |
@@ -95,7 +95,7 @@ static struct pm_qos_object network_lat_pm_qos = { | |||
95 | 95 | ||
96 | static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier); | 96 | static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier); |
97 | static struct pm_qos_object network_throughput_pm_qos = { | 97 | static struct pm_qos_object network_throughput_pm_qos = { |
98 | .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests, pm_qos_lock), | 98 | .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests), |
99 | .notifiers = &network_throughput_notifier, | 99 | .notifiers = &network_throughput_notifier, |
100 | .name = "network_throughput", | 100 | .name = "network_throughput", |
101 | .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, | 101 | .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, |
@@ -104,11 +104,59 @@ static struct pm_qos_object network_throughput_pm_qos = { | |||
104 | }; | 104 | }; |
105 | 105 | ||
106 | 106 | ||
107 | static BLOCKING_NOTIFIER_HEAD(min_online_cpus_notifier); | ||
108 | static struct pm_qos_object min_online_cpus_pm_qos = { | ||
109 | .requests = PLIST_HEAD_INIT(min_online_cpus_pm_qos.requests), | ||
110 | .notifiers = &min_online_cpus_notifier, | ||
111 | .name = "min_online_cpus", | ||
112 | .target_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE, | ||
113 | .default_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE, | ||
114 | .type = PM_QOS_MAX, | ||
115 | }; | ||
116 | |||
117 | |||
118 | static BLOCKING_NOTIFIER_HEAD(max_online_cpus_notifier); | ||
119 | static struct pm_qos_object max_online_cpus_pm_qos = { | ||
120 | .requests = PLIST_HEAD_INIT(max_online_cpus_pm_qos.requests), | ||
121 | .notifiers = &max_online_cpus_notifier, | ||
122 | .name = "max_online_cpus", | ||
123 | .target_value = PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE, | ||
124 | .default_value = PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE, | ||
125 | .type = PM_QOS_MIN, | ||
126 | }; | ||
127 | |||
128 | |||
129 | static BLOCKING_NOTIFIER_HEAD(cpu_freq_min_notifier); | ||
130 | static struct pm_qos_object cpu_freq_min_pm_qos = { | ||
131 | .requests = PLIST_HEAD_INIT(cpu_freq_min_pm_qos.requests), | ||
132 | .notifiers = &cpu_freq_min_notifier, | ||
133 | .name = "cpu_freq_min", | ||
134 | .target_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE, | ||
135 | .default_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE, | ||
136 | .type = PM_QOS_MAX, | ||
137 | }; | ||
138 | |||
139 | |||
140 | static BLOCKING_NOTIFIER_HEAD(cpu_freq_max_notifier); | ||
141 | static struct pm_qos_object cpu_freq_max_pm_qos = { | ||
142 | .requests = PLIST_HEAD_INIT(cpu_freq_max_pm_qos.requests), | ||
143 | .notifiers = &cpu_freq_max_notifier, | ||
144 | .name = "cpu_freq_max", | ||
145 | .target_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE, | ||
146 | .default_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE, | ||
147 | .type = PM_QOS_MIN, | ||
148 | }; | ||
149 | |||
150 | |||
107 | static struct pm_qos_object *pm_qos_array[] = { | 151 | static struct pm_qos_object *pm_qos_array[] = { |
108 | &null_pm_qos, | 152 | &null_pm_qos, |
109 | &cpu_dma_pm_qos, | 153 | &cpu_dma_pm_qos, |
110 | &network_lat_pm_qos, | 154 | &network_lat_pm_qos, |
111 | &network_throughput_pm_qos | 155 | &network_throughput_pm_qos, |
156 | &min_online_cpus_pm_qos, | ||
157 | &max_online_cpus_pm_qos, | ||
158 | &cpu_freq_min_pm_qos, | ||
159 | &cpu_freq_max_pm_qos | ||
112 | }; | 160 | }; |
113 | 161 | ||
114 | static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, | 162 | static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, |
@@ -459,21 +507,18 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, | |||
459 | static int __init pm_qos_power_init(void) | 507 | static int __init pm_qos_power_init(void) |
460 | { | 508 | { |
461 | int ret = 0; | 509 | int ret = 0; |
510 | int i; | ||
462 | 511 | ||
463 | ret = register_pm_qos_misc(&cpu_dma_pm_qos); | 512 | BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES); |
464 | if (ret < 0) { | 513 | |
465 | printk(KERN_ERR "pm_qos_param: cpu_dma_latency setup failed\n"); | 514 | for (i = 1; i < PM_QOS_NUM_CLASSES; i++) { |
466 | return ret; | 515 | ret = register_pm_qos_misc(pm_qos_array[i]); |
467 | } | 516 | if (ret < 0) { |
468 | ret = register_pm_qos_misc(&network_lat_pm_qos); | 517 | printk(KERN_ERR "pm_qos_param: %s setup failed\n", |
469 | if (ret < 0) { | 518 | pm_qos_array[i]->name); |
470 | printk(KERN_ERR "pm_qos_param: network_latency setup failed\n"); | 519 | return ret; |
471 | return ret; | 520 | } |
472 | } | 521 | } |
473 | ret = register_pm_qos_misc(&network_throughput_pm_qos); | ||
474 | if (ret < 0) | ||
475 | printk(KERN_ERR | ||
476 | "pm_qos_param: network_throughput setup failed\n"); | ||
477 | 522 | ||
478 | return ret; | 523 | return ret; |
479 | } | 524 | } |