diff options
author | Antti P Miettinen <amiettinen@nvidia.com> | 2011-12-27 12:28:21 +0200 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:33:00 -0700 |
commit | d11d7c254c57a99330bcce9b114edc1bcad34fb4 (patch) | |
tree | f8e776d8e5a272bc949c83531e8635a4402e687e | |
parent | ff58d52e3016f23cfe9fb4059de1b95961f836a6 (diff) |
PM QoS: Add CPU frequency min/max as PM QoS params
Add minimum and maximum CPU frequency as PM QoS parameters.
Bug 888312
Change-Id: I18abddded35a044a6ad8365035e31d1a2213a329
Reviewed-on: http://git-master/r/72206
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/75883
Reviewed-by: Automatic_Commit_Validation_User
Rebase-Id: R1007bbef60489ecc81a9acd0ce3b0abfa9a05f3e
-rw-r--r-- | include/linux/pm_qos.h | 4 | ||||
-rw-r--r-- | kernel/power/qos.c | 32 |
2 files changed, 35 insertions, 1 deletions
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 9b403166a6af..30300876d085 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -16,6 +16,8 @@ enum { PM_QOS_NETWORK_LATENCY, PM_QOS_NETWORK_THROUGHPUT, PM_QOS_MAX_ONLINE_CPUS, + PM_QOS_CPU_FREQ_MIN, + PM_QOS_CPU_FREQ_MAX, /* insert new class ID */ PM_QOS_NUM_CLASSES, @@ -34,6 +36,8 @@ enum pm_qos_flags_status { #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE LONG_MAX +#define PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE 0 +#define PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE LONG_MAX #define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 37b9a69cb4b6..7eb186fbecb8 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -115,12 +115,42 @@ static struct pm_qos_object max_online_cpus_pm_qos = { }; +static BLOCKING_NOTIFIER_HEAD(cpu_freq_min_notifier); +static struct pm_qos_constraints cpu_freq_min_constraints = { + .list = PLIST_HEAD_INIT(cpu_freq_min_constraints.list), + .target_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE, + .default_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &cpu_freq_min_notifier, +}; +static struct pm_qos_object cpu_freq_min_pm_qos = { + .constraints = &cpu_freq_min_constraints, + .name = "cpu_freq_min", +}; + + +static BLOCKING_NOTIFIER_HEAD(cpu_freq_max_notifier); +static struct pm_qos_constraints cpu_freq_max_constraints = { + .list = PLIST_HEAD_INIT(cpu_freq_max_constraints.list), + .target_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, + .notifiers = &cpu_freq_max_notifier, +}; +static struct pm_qos_object cpu_freq_max_pm_qos = { + .constraints = &cpu_freq_max_constraints, + .name = "cpu_freq_max", +}; + + static struct pm_qos_object *pm_qos_array[] = { &null_pm_qos, &cpu_dma_pm_qos, &network_lat_pm_qos, &network_throughput_pm_qos, - &max_online_cpus_pm_qos + &max_online_cpus_pm_qos, + &cpu_freq_min_pm_qos, + &cpu_freq_max_pm_qos }; static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, |