[COMMON] pm_qos: add pm_qos_class for cpu
authorPark Bumgyu <bumgyu.park@samsung.com>
Wed, 17 Jan 2018 01:39:43 +0000 (10:39 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:04 +0000 (17:09 +0900)
Change-Id: Iebb3ff8c074c45d7604bb73fa84bb4ae34d4d09b
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
include/linux/pm_qos.h
kernel/power/qos.c

index 7b2919afe017200ab413f0cf9c60ea56677e5f9f..9c2d429ac7b4e7cb8bf9d40e86d37e4275496cc2 100644 (file)
@@ -14,6 +14,12 @@ enum {
        PM_QOS_RESERVED = 0,
        PM_QOS_CPU_DMA_LATENCY,
        PM_QOS_NETWORK_LATENCY,
+       PM_QOS_CLUSTER0_FREQ_MIN,
+       PM_QOS_CLUSTER0_FREQ_MAX,
+       PM_QOS_CLUSTER1_FREQ_MIN,
+       PM_QOS_CLUSTER1_FREQ_MAX,
+       PM_QOS_CPU_ONLINE_MIN,
+       PM_QOS_CPU_ONLINE_MAX,
        PM_QOS_DEVICE_THROUGHPUT,
        PM_QOS_INTCAM_THROUGHPUT,
 #ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
@@ -85,6 +91,10 @@ enum pm_qos_flags_status {
 #define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0
 #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1)
 #define PM_QOS_LATENCY_ANY                     ((s32)(~(__u32)0 >> 1))
+#define PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE      0
+#define PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE      INT_MAX
+#define PM_QOS_CPU_ONLINE_MIN_DEFAULT_VALUE    1
+#define PM_QOS_CPU_ONLINE_MAX_DEFAULT_VALUE    NR_CPUS
 
 #define PM_QOS_FLAG_NO_POWER_OFF       (1 << 0)
 #define PM_QOS_FLAG_REMOTE_WAKEUP      (1 << 1)
index c63e1c5ee1a55128d7058c6c6b09a65b61ce2f83..60f027b8c55928343d49f9823376e51746379bfa 100644 (file)
@@ -91,7 +91,6 @@ static struct pm_qos_object network_lat_pm_qos = {
        .name = "network_latency",
 };
 
-
 static BLOCKING_NOTIFIER_HEAD(device_throughput_notifier);
 static struct pm_qos_constraints device_tput_constraints = {
        .list = PLIST_HEAD_INIT(device_tput_constraints.list),
@@ -203,6 +202,83 @@ static struct pm_qos_object memory_bandwidth_pm_qos = {
        .name = "memory_bandwidth",
 };
 
+static BLOCKING_NOTIFIER_HEAD(cluster1_freq_min_notifier);
+static struct pm_qos_constraints cluster1_freq_min_constraints = {
+       .list = PLIST_HEAD_INIT(cluster1_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 = &cluster1_freq_min_notifier,
+};
+static struct pm_qos_object cluster1_freq_min_pm_qos = {
+       .constraints = &cluster1_freq_min_constraints,
+       .name = "cluster1_freq_min",
+};
+
+static BLOCKING_NOTIFIER_HEAD(cluster1_freq_max_notifier);
+static struct pm_qos_constraints cluster1_freq_max_constraints = {
+       .list = PLIST_HEAD_INIT(cluster1_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 = &cluster1_freq_max_notifier,
+};
+static struct pm_qos_object cluster1_freq_max_pm_qos = {
+       .constraints = &cluster1_freq_max_constraints,
+       .name = "cluster1_freq_max",
+};
+
+static BLOCKING_NOTIFIER_HEAD(cluster0_freq_min_notifier);
+static struct pm_qos_constraints cluster0_freq_min_constraints = {
+       .list = PLIST_HEAD_INIT(cluster0_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 = &cluster0_freq_min_notifier,
+};
+static struct pm_qos_object cluster0_freq_min_pm_qos = {
+       .constraints = &cluster0_freq_min_constraints,
+       .name = "cluster0_freq_min",
+};
+
+static BLOCKING_NOTIFIER_HEAD(cluster0_freq_max_notifier);
+static struct pm_qos_constraints cluster0_freq_max_constraints = {
+       .list = PLIST_HEAD_INIT(cluster0_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 = &cluster0_freq_max_notifier,
+};
+static struct pm_qos_object cluster0_freq_max_pm_qos = {
+       .constraints = &cluster0_freq_max_constraints,
+       .name = "cluster0_freq_max",
+};
+
+static BLOCKING_NOTIFIER_HEAD(cpu_online_min_notifier);
+static struct pm_qos_constraints cpu_online_min_constraints = {
+       .list = PLIST_HEAD_INIT(cpu_online_min_constraints.list),
+       .target_value = PM_QOS_CPU_ONLINE_MIN_DEFAULT_VALUE,
+       .default_value = PM_QOS_CPU_ONLINE_MIN_DEFAULT_VALUE,
+       .type = PM_QOS_MAX,
+       .notifiers = &cpu_online_min_notifier,
+};
+static struct pm_qos_object cpu_online_min_pm_qos = {
+       .constraints = &cpu_online_min_constraints,
+       .name = "cpu_online_min",
+};
+
+static BLOCKING_NOTIFIER_HEAD(cpu_online_max_notifier);
+static struct pm_qos_constraints cpu_online_max_constraints = {
+       .list = PLIST_HEAD_INIT(cpu_online_max_constraints.list),
+       .target_value = PM_QOS_CPU_ONLINE_MAX_DEFAULT_VALUE,
+       .default_value = PM_QOS_CPU_ONLINE_MAX_DEFAULT_VALUE,
+       .type = PM_QOS_MIN,
+       .notifiers = &cpu_online_max_notifier,
+};
+static struct pm_qos_object cpu_online_max_pm_qos = {
+       .constraints = &cpu_online_max_constraints,
+       .name = "cpu_online_max",
+};
 
 static BLOCKING_NOTIFIER_HEAD(display_throughput_notifier);
 static struct pm_qos_constraints display_tput_constraints = {
@@ -368,6 +444,12 @@ static struct pm_qos_object *pm_qos_array[] = {
        &null_pm_qos,
        &cpu_dma_pm_qos,
        &network_lat_pm_qos,
+       &cluster0_freq_min_pm_qos,
+       &cluster0_freq_max_pm_qos,
+       &cluster1_freq_min_pm_qos,
+       &cluster1_freq_max_pm_qos,
+       &cpu_online_min_pm_qos,
+       &cpu_online_max_pm_qos,
        &device_throughput_pm_qos,
        &intcam_throughput_pm_qos,
 #ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG