summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/intel_pstate.c
diff options
context:
space:
mode:
authorRafael J. Wysocki2016-04-02 01:08:43 +0200
committerRafael J. Wysocki2016-04-02 01:08:43 +0200
commit0bed612be638e41456cd8cb270a2b411a5b43d63 (patch)
tree02b294dcea4c15378525c456314af36334a87f4a /drivers/cpufreq/intel_pstate.c
parentMerge back intel_pstate fixes for v4.6. (diff)
downloadkernel-qcow2-linux-0bed612be638e41456cd8cb270a2b411a5b43d63.tar.gz
kernel-qcow2-linux-0bed612be638e41456cd8cb270a2b411a5b43d63.tar.xz
kernel-qcow2-linux-0bed612be638e41456cd8cb270a2b411a5b43d63.zip
cpufreq: sched: Helpers to add and remove update_util hooks
Replace the single helper for adding and removing cpufreq utilization update hooks, cpufreq_set_update_util_data(), with a pair of helpers, cpufreq_add_update_util_hook() and cpufreq_remove_update_util_hook(), and modify the users of cpufreq_set_update_util_data() accordingly. With the new helpers, the code using them doesn't need to worry about the internals of struct update_util_data and in particular it doesn't need to worry about populating the func field in it properly upfront. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r--drivers/cpufreq/intel_pstate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 9ae159631f52..a38219527637 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1107,8 +1107,6 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
intel_pstate_busy_pid_reset(cpu);
- cpu->update_util.func = intel_pstate_update_util;
-
pr_debug("intel_pstate: controlling: cpu %d\n", cpunum);
return 0;
@@ -1132,12 +1130,13 @@ static void intel_pstate_set_update_util_hook(unsigned int cpu_num)
/* Prevent intel_pstate_update_util() from using stale data. */
cpu->sample.time = 0;
- cpufreq_set_update_util_data(cpu_num, &cpu->update_util);
+ cpufreq_add_update_util_hook(cpu_num, &cpu->update_util,
+ intel_pstate_update_util);
}
static void intel_pstate_clear_update_util_hook(unsigned int cpu)
{
- cpufreq_set_update_util_data(cpu, NULL);
+ cpufreq_remove_update_util_hook(cpu);
synchronize_sched();
}