summaryrefslogtreecommitdiffstats
path: root/meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch
diff options
context:
space:
mode:
authorFrode Isaksen <fisaksen@baylibre.com>2017-12-19 11:15:35 +0000
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-02-07 11:47:29 +0000
commitc4a6287185179732dfc1e903c195ff90c19f1065 (patch)
treed35f5010dbd952e40f5c178322026445b55757c1 /meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch
parent109dea1d5c5a38807b098b588584636ae636a302 (diff)
This layer provides Energy Aware Scheduling (EAS) patcheseel_5.1.0eel_5.0.3eel_5.0.2eel/5.1.0eel/5.0.3eel/5.0.25.1.05.0.35.0.2eel
For the moment only for Renesas R-Car Gen3 SoC's. Can be expanded for other SoC's by setting the machine feature biglittle and provide the relevant EAS patches. Bug-AGL: SPEC-813 Change-Id: I2b5e69c515c33e57be19b30466fe208d7b8ac1a5 Signed-off-by: Frode Isaksen <fisaksen@baylibre.com>
Diffstat (limited to 'meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch')
-rw-r--r--meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch b/meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch
new file mode 100644
index 0000000..29fdd5c
--- /dev/null
+++ b/meta-eas/recipes-kernel/linux/linux-renesas/0092-cpufreq-schedutil-Use-policy-dependent-transition-de.patch
@@ -0,0 +1,93 @@
+From fd991617b51a628a72bdb45b20fbc5c01d666b70 Mon Sep 17 00:00:00 2001
+From: Gaku Inami <gaku.inami.xw@bp.renesas.com>
+Date: Fri, 7 Jul 2017 15:04:31 +0900
+Subject: [PATCH 92/92] cpufreq: schedutil: Use policy-dependent transition
+ delays for R-Car
+
+Make the schedutil governor take the initial (default) value of the
+rate_limit_us sysfs attribute from the (new) transition_delay_us
+policy parameter (to be set by the scaling driver).
+
+That will allow scaling drivers to make schedutil use smaller default
+values of rate_limit_us and reduce the default average time interval
+between consecutive frequency changes.
+
+The cpufreq-dt driver for R-Car H3/M3 set transition_delay_us to value
+same as transition_latency.
+
+Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
+---
+ drivers/cpufreq/cpufreq-dt.c | 4 ++++
+ include/linux/cpufreq.h | 7 +++++++
+ kernel/sched/cpufreq_schedutil.c | 15 ++++++++++-----
+ 3 files changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
+index 5c07ae0..57cd54e 100644
+--- a/drivers/cpufreq/cpufreq-dt.c
++++ b/drivers/cpufreq/cpufreq-dt.c
+@@ -276,6 +276,10 @@ static int cpufreq_init(struct cpufreq_policy *policy)
+
+ policy->cpuinfo.transition_latency = transition_latency;
+
++#if IS_ENABLED(CONFIG_ARCH_R8A7795) || IS_ENABLED(CONFIG_ARCH_R8A7796)
++ policy->transition_delay_us = transition_latency;
++#endif
++
+ return 0;
+
+ out_free_cpufreq_table:
+diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
+index 32dc0cbd..7df5d88 100644
+--- a/include/linux/cpufreq.h
++++ b/include/linux/cpufreq.h
+@@ -120,6 +120,13 @@ struct cpufreq_policy {
+ bool fast_switch_possible;
+ bool fast_switch_enabled;
+
++ /*
++ * Preferred average time interval between consecutive invocations of
++ * the driver to set the frequency for this policy. To be set by the
++ * scaling driver (0, which is the default, means no preference).
++ */
++ unsigned int transition_delay_us;
++
+ /* Cached frequency lookup from cpufreq_driver_resolve_freq. */
+ unsigned int cached_target_freq;
+ int cached_resolved_idx;
+diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
+index 42a220e..9668e0e 100644
+--- a/kernel/sched/cpufreq_schedutil.c
++++ b/kernel/sched/cpufreq_schedutil.c
+@@ -473,7 +473,6 @@ static int sugov_init(struct cpufreq_policy *policy)
+ {
+ struct sugov_policy *sg_policy;
+ struct sugov_tunables *tunables;
+- unsigned int lat;
+ int ret = 0;
+
+ /* State should be equivalent to EXIT */
+@@ -512,10 +511,16 @@ static int sugov_init(struct cpufreq_policy *policy)
+ goto stop_kthread;
+ }
+
+- tunables->rate_limit_us = LATENCY_MULTIPLIER;
+- lat = policy->cpuinfo.transition_latency / NSEC_PER_USEC;
+- if (lat)
+- tunables->rate_limit_us *= lat;
++ if (policy->transition_delay_us) {
++ tunables->rate_limit_us = policy->transition_delay_us;
++ } else {
++ unsigned int lat;
++
++ tunables->rate_limit_us = LATENCY_MULTIPLIER;
++ lat = policy->cpuinfo.transition_latency / NSEC_PER_USEC;
++ if (lat)
++ tunables->rate_limit_us *= lat;
++ }
+
+ policy->governor_data = sg_policy;
+ sg_policy->tunables = tunables;
+--
+1.9.1
+