Skip to content

Commit ea9364b

Browse files
committed
cpufreq: Add strict_target to struct cpufreq_policy
Add a new field to be set when the CPUFREQ_GOV_STRICT_TARGET flag is set for the current governor to struct cpufreq_policy, so that the drivers needing to check CPUFREQ_GOV_STRICT_TARGET do not have to access the governor object during every frequency transition. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 218f668 commit ea9364b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,8 @@ static int cpufreq_init_governor(struct cpufreq_policy *policy)
22802280
}
22812281
}
22822282

2283+
policy->strict_target = !!(policy->governor->flags & CPUFREQ_GOV_STRICT_TARGET);
2284+
22832285
return 0;
22842286
}
22852287

include/linux/cpufreq.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ struct cpufreq_policy {
109109
bool fast_switch_possible;
110110
bool fast_switch_enabled;
111111

112+
/*
113+
* Set if the CPUFREQ_GOV_STRICT_TARGET flag is set for the current
114+
* governor.
115+
*/
116+
bool strict_target;
117+
112118
/*
113119
* Preferred average time interval between consecutive invocations of
114120
* the driver to set the frequency for this policy. To be set by the

0 commit comments

Comments
 (0)