]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 10 Nov 2020 17:26:10 +0000 (18:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:30 +0000 (19:22 +0100)
commit 218f66870181bec7aaa6e3c72f346039c590c3c2 upstream.

Introduce a new governor flag, CPUFREQ_GOV_STRICT_TARGET, for the
governors that want the target frequency to be set exactly to the
given value without leaving any room for adjustments on the hardware
side and set this flag for the powersave and performance governors.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/cpufreq_performance.c
drivers/cpufreq/cpufreq_powersave.c
include/linux/cpufreq.h

index 71c1d9aba77271957dbb3f4bccacbba9c20674d3..addd93f2a4202bb832053186ff8d9faf077c8f91 100644 (file)
@@ -20,6 +20,7 @@ static void cpufreq_gov_performance_limits(struct cpufreq_policy *policy)
 static struct cpufreq_governor cpufreq_gov_performance = {
        .name           = "performance",
        .owner          = THIS_MODULE,
+       .flags          = CPUFREQ_GOV_STRICT_TARGET,
        .limits         = cpufreq_gov_performance_limits,
 };
 
index 7749522355b5946914ac8099d58789a75729c1a2..8d830d860e9129baa02aaa6f384c433160a26f86 100644 (file)
@@ -21,6 +21,7 @@ static struct cpufreq_governor cpufreq_gov_powersave = {
        .name           = "powersave",
        .limits         = cpufreq_gov_powersave_limits,
        .owner          = THIS_MODULE,
+       .flags          = CPUFREQ_GOV_STRICT_TARGET,
 };
 
 MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
index 8bd886c16cc49e41228f5489e4b6ef5d40cfd0f9..47ab3cb113341a064fb31a0af7f71c7335dcfcaf 100644 (file)
@@ -575,6 +575,9 @@ struct cpufreq_governor {
 /* For governors which change frequency dynamically by themselves */
 #define CPUFREQ_GOV_DYNAMIC_SWITCHING  BIT(0)
 
+/* For governors wanting the target frequency to be set exactly */
+#define CPUFREQ_GOV_STRICT_TARGET      BIT(1)
+
 
 /* Pass a target to the cpufreq driver */
 unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,