Skip to content

Commit 218f668

Browse files
committed
cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET
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>
1 parent 9a2a9eb commit 218f668

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/cpufreq/cpufreq_performance.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ static void cpufreq_gov_performance_limits(struct cpufreq_policy *policy)
2020
static struct cpufreq_governor cpufreq_gov_performance = {
2121
.name = "performance",
2222
.owner = THIS_MODULE,
23+
.flags = CPUFREQ_GOV_STRICT_TARGET,
2324
.limits = cpufreq_gov_performance_limits,
2425
};
2526

drivers/cpufreq/cpufreq_powersave.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static struct cpufreq_governor cpufreq_gov_powersave = {
2121
.name = "powersave",
2222
.limits = cpufreq_gov_powersave_limits,
2323
.owner = THIS_MODULE,
24+
.flags = CPUFREQ_GOV_STRICT_TARGET,
2425
};
2526

2627
MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");

include/linux/cpufreq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,9 @@ struct cpufreq_governor {
580580
/* For governors which change frequency dynamically by themselves */
581581
#define CPUFREQ_GOV_DYNAMIC_SWITCHING BIT(0)
582582

583+
/* For governors wanting the target frequency to be set exactly */
584+
#define CPUFREQ_GOV_STRICT_TARGET BIT(1)
585+
583586

584587
/* Pass a target to the cpufreq driver */
585588
unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,

0 commit comments

Comments
 (0)