From eb7765563bde7be414809dcf9e2855ef7d18cd43 Mon Sep 17 00:00:00 2001 From: Taikyung yu Date: Mon, 5 Jan 2015 19:11:59 +0900 Subject: [PATCH] PM QOS: add PM_QOS_BUS_THROUGHPUT_MAX for MIF Change-Id: I4f6582e1b89a9ed905059ff05d3f4f07069f4c38 Signed-off-by: Taikyung yu --- include/linux/devfreq.h | 33 +++++++++++++++++++++++++++++++++ include/linux/pm_qos.h | 2 ++ kernel/power/qos.c | 14 ++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 597294e0cc40..cca31812cc83 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -231,6 +231,39 @@ extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, struct devfreq_simple_ondemand_data { unsigned int upthreshold; unsigned int downdifferential; + unsigned long cal_qos_max; + int pm_qos_class; + struct devfreq_notifier_block nb; +}; +#endif + +#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_USAGE) +struct devfreq_simple_usage_data { + unsigned int multiplication_weight; + unsigned int proportional; + unsigned int upthreshold; + unsigned int target_percentage; + int pm_qos_class; + unsigned long cal_qos_max; + bool en_monitoring; + struct devfreq_notifier_block nb; +}; +#endif + +#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_EXYNOS) +struct devfreq_simple_exynos_data { + unsigned int urgentthreshold; + unsigned int upthreshold; + unsigned int downthreshold; + unsigned int idlethreshold; + unsigned long above_freq; + unsigned long below_freq; + int pm_qos_class; + int pm_qos_class_max; + unsigned long cal_qos_max; + bool en_monitoring; + struct devfreq_notifier_block nb; + struct devfreq_notifier_block nb_max; }; #endif diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index b4ece3c86581..97e0bf61c565 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -16,6 +16,7 @@ enum { PM_QOS_NETWORK_LATENCY, PM_QOS_DEVICE_THROUGHPUT, PM_QOS_BUS_THROUGHPUT, + PM_QOS_BUS_THROUGHPUT_MAX, PM_QOS_NETWORK_THROUGHPUT, PM_QOS_MEMORY_BANDWIDTH, PM_QOS_DISPLAY_THROUGHPUT, @@ -38,6 +39,7 @@ enum pm_qos_flags_status { #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) #define PM_QOS_DEVICE_THROUGHPUT_DEFAULT_VALUE 0 #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 #define PM_QOS_CAM_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 555709dd8198..02d95c9d9a1a 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -118,6 +118,19 @@ static struct pm_qos_object bus_throughput_pm_qos = { .name = "bus_throughput", }; +static BLOCKING_NOTIFIER_HEAD(bus_throughput_max_notifier); +static struct pm_qos_constraints bus_tput_max_constraints = { + .list = PLIST_HEAD_INIT(bus_tput_max_constraints.list), + .target_value = PM_QOS_BUS_THROUGHPUT_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_BUS_THROUGHPUT_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, + .notifiers = &bus_throughput_max_notifier, +}; +static struct pm_qos_object bus_throughput_max_pm_qos = { + .constraints = &bus_tput_max_constraints, + .name = "bus_throughput_max", +}; + static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier); static struct pm_qos_constraints network_tput_constraints = { .list = PLIST_HEAD_INIT(network_tput_constraints.list), @@ -181,6 +194,7 @@ static struct pm_qos_object *pm_qos_array[] = { &network_lat_pm_qos, &device_throughput_pm_qos, &bus_throughput_pm_qos, + &bus_throughput_max_pm_qos, &network_throughput_pm_qos, &memory_bandwidth_pm_qos, &display_throughput_pm_qos, -- 2.20.1