[COMMON] devfreq: Add pm_qos_max class
authorHaksu Kim <mail_id@samsung.com>
Thu, 21 Jan 2016 04:33:11 +0000 (13:33 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:01 +0000 (17:09 +0900)
Devfreq will have new governor using pm_qos_max class on debug mode.

Change-Id: I08d9cd502910802982d473371bcea70e414e1de8
Signed-off-by: Haksu Kim <mail_id@samsung.com>
include/linux/pm_qos.h
kernel/power/qos.c

index 7b729077347fee1437e1c70fd5ebe4a2fff391e9..531f0a95d4330343b2fddef1fb8acbce927cbae9 100644 (file)
@@ -15,12 +15,21 @@ enum {
        PM_QOS_CPU_DMA_LATENCY,
        PM_QOS_NETWORK_LATENCY,
        PM_QOS_DEVICE_THROUGHPUT,
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+       PM_QOS_DEVICE_THROUGHPUT_MAX,
+#endif
        PM_QOS_BUS_THROUGHPUT,
        PM_QOS_BUS_THROUGHPUT_MAX,
        PM_QOS_NETWORK_THROUGHPUT,
        PM_QOS_MEMORY_BANDWIDTH,
        PM_QOS_DISPLAY_THROUGHPUT,
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+       PM_QOS_DISPLAY_THROUGHPUT_MAX,
+#endif
        PM_QOS_CAM_THROUGHPUT,
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+       PM_QOS_CAM_THROUGHPUT_MAX,
+#endif
 
        /* insert new class ID */
        PM_QOS_NUM_CLASSES,
@@ -38,10 +47,19 @@ enum pm_qos_flags_status {
 #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE       (2000 * USEC_PER_SEC)
 #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE       (2000 * USEC_PER_SEC)
 #define PM_QOS_DEVICE_THROUGHPUT_DEFAULT_VALUE 0
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+#define PM_QOS_DEVICE_THROUGHPUT_MAX_DEFAULT_VALUE     INT_MAX
+#endif
 #define PM_QOS_BUS_THROUGHPUT_DEFAULT_VALUE    0
 #define PM_QOS_BUS_THROUGHPUT_MAX_DEFAULT_VALUE        INT_MAX
 #define PM_QOS_DISPLAY_THROUGHPUT_DEFAULT_VALUE        0
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+#define PM_QOS_DISPLAY_THROUGHPUT_MAX_DEFAULT_VALUE    INT_MAX
+#endif
 #define PM_QOS_CAM_THROUGHPUT_DEFAULT_VALUE    0
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+#define PM_QOS_CAM_THROUGHPUT_MAX_DEFAULT_VALUE        INT_MAX
+#endif
 #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE        0
 #define PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE  0
 #define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE    0
index 26ffa3a02d06f201b72b5d65ec3c3724a6534fbe..0906e70abb69c70e150f15911aafee3727109e6b 100644 (file)
@@ -105,6 +105,21 @@ static struct pm_qos_object device_throughput_pm_qos = {
        .name = "device_throughput",
 };
 
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+static BLOCKING_NOTIFIER_HEAD(device_throughput_max_notifier);
+static struct pm_qos_constraints device_tput_max_constraints = {
+       .list = PLIST_HEAD_INIT(device_tput_max_constraints.list),
+       .target_value = PM_QOS_DEVICE_THROUGHPUT_MAX_DEFAULT_VALUE,
+       .default_value = PM_QOS_DEVICE_THROUGHPUT_MAX_DEFAULT_VALUE,
+       .type = PM_QOS_MIN,
+       .notifiers = &device_throughput_max_notifier,
+};
+static struct pm_qos_object device_throughput_max_pm_qos = {
+       .constraints = &device_tput_max_constraints,
+       .name = "device_throughput_max",
+};
+#endif
+
 static BLOCKING_NOTIFIER_HEAD(bus_throughput_notifier);
 static struct pm_qos_constraints bus_tput_constraints = {
        .list = PLIST_HEAD_INIT(bus_tput_constraints.list),
@@ -174,6 +189,21 @@ static struct pm_qos_object display_throughput_pm_qos = {
        .name = "display_throughput",
 };
 
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+static BLOCKING_NOTIFIER_HEAD(display_throughput_max_notifier);
+static struct pm_qos_constraints display_tput_max_constraints = {
+       .list = PLIST_HEAD_INIT(display_tput_max_constraints.list),
+       .target_value = PM_QOS_DISPLAY_THROUGHPUT_MAX_DEFAULT_VALUE,
+       .default_value = PM_QOS_DISPLAY_THROUGHPUT_MAX_DEFAULT_VALUE,
+       .type = PM_QOS_MIN,
+       .notifiers = &display_throughput_max_notifier,
+};
+static struct pm_qos_object display_throughput_max_pm_qos = {
+       .constraints = &display_tput_max_constraints,
+       .name = "display_throughput_max",
+};
+#endif
+
 static BLOCKING_NOTIFIER_HEAD(cam_throughput_notifier);
 static struct pm_qos_constraints cam_tput_constraints = {
        .list = PLIST_HEAD_INIT(cam_tput_constraints.list),
@@ -187,18 +217,41 @@ static struct pm_qos_object cam_throughput_pm_qos = {
        .name = "cam_throughput",
 };
 
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+static BLOCKING_NOTIFIER_HEAD(cam_throughput_max_notifier);
+static struct pm_qos_constraints cam_tput_max_constraints = {
+       .list = PLIST_HEAD_INIT(cam_tput_max_constraints.list),
+       .target_value = PM_QOS_CAM_THROUGHPUT_MAX_DEFAULT_VALUE,
+       .default_value = PM_QOS_CAM_THROUGHPUT_MAX_DEFAULT_VALUE,
+       .type = PM_QOS_MIN,
+       .notifiers = &cam_throughput_max_notifier,
+};
+static struct pm_qos_object cam_throughput_max_pm_qos = {
+       .constraints = &cam_tput_max_constraints,
+       .name = "cam_throughput_max",
+};
+#endif
 
 static struct pm_qos_object *pm_qos_array[] = {
        &null_pm_qos,
        &cpu_dma_pm_qos,
        &network_lat_pm_qos,
        &device_throughput_pm_qos,
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+       &device_throughput_max_pm_qos,
+#endif
        &bus_throughput_pm_qos,
        &bus_throughput_max_pm_qos,
        &network_throughput_pm_qos,
        &memory_bandwidth_pm_qos,
        &display_throughput_pm_qos,
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+       &display_throughput_max_pm_qos,
+#endif
        &cam_throughput_pm_qos,
+#ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG
+       &cam_throughput_max_pm_qos,
+#endif
 };
 
 static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,