Skip to content

Commit

Permalink
cpufreq: Add strict_target to struct cpufreq_policy
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki committed Nov 10, 2020
1 parent 218f668 commit ea9364b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,8 @@ static int cpufreq_init_governor(struct cpufreq_policy *policy)
}
}

policy->strict_target = !!(policy->governor->flags & CPUFREQ_GOV_STRICT_TARGET);

return 0;
}

Expand Down
6 changes: 6 additions & 0 deletions include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ struct cpufreq_policy {
bool fast_switch_possible;
bool fast_switch_enabled;

/*
* Set if the CPUFREQ_GOV_STRICT_TARGET flag is set for the current
* governor.
*/
bool strict_target;

/*
* Preferred average time interval between consecutive invocations of
* the driver to set the frequency for this policy. To be set by the
Expand Down

0 comments on commit ea9364b

Please sign in to comment.