summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-03-28 23:48:54 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-04-09 22:22:18 +0300
commiteaff6b62d3439ca6ee00dba4f77673a8c37dac20 (patch)
tree7b708d66abf301f1befbf3df36a50a48673318a2 /include/linux
parent684e1855211145b71f8d9aaa49d2cc67067cd42a (diff)
downloadlinux-eaff6b62d3439ca6ee00dba4f77673a8c37dac20.tar.xz
cpufreq: Pass policy pointer to ->update_limits()
Since cpufreq_update_limits() obtains a cpufreq policy pointer for the given CPU and reference counts the corresponding policy object, it may as well pass the policy pointer to the cpufreq driver's ->update_limits() callback which allows that callback to avoid invoking cpufreq_cpu_get() for the same CPU. Accordingly, redefine ->update_limits() to take a policy pointer instead of a CPU number and update both drivers implementing it, intel_pstate and amd-pstate, as needed. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Tested-by: Sudeep Holla <sudeep.holla@arm.com> Link: https://patch.msgid.link/8560367.NyiUUSuA9g@rjwysocki.net
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpufreq.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index a33a094ef755..f3cf2adea18f 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -399,7 +399,7 @@ struct cpufreq_driver {
unsigned int (*get)(unsigned int cpu);
/* Called to update policy limits on firmware notifications. */
- void (*update_limits)(unsigned int cpu);
+ void (*update_limits)(struct cpufreq_policy *policy);
/* optional */
int (*bios_limit)(int cpu, unsigned int *limit);