aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-03-26 07:15:13 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-04-01 17:43:05 -0400
commit5a25e3f7cc538fb49e11267c1e41c54ccf83835e (patch)
treee964c1948f3065cc885e0c36fe1b061c3d5ffd45 /include/linux/cpufreq.h
parent79a3aaa7b82e3106be97842dedfd8429248896e6 (diff)
cpufreq: intel_pstate: Driver-specific handling of _PPC updates
In some cases, the platform firmware disables or enables turbo frequencies for all CPUs globally before triggering a _PPC change notification for one of them. Obviously, that global change affects all CPUs, not just the notified one, and it needs to be acted upon by cpufreq. The intel_pstate driver is able to detect such global changes of the settings, but it also needs to update policy limits for all CPUs if that happens, in particular if turbo frequencies are enabled globally - to allow them to be used. For this reason, introduce a new cpufreq driver callback to be invoked on _PPC notifications, if present, instead of simply calling cpufreq_update_policy() for the notified CPU and make intel_pstate use it to trigger policy updates for all CPUs in the system if global settings change. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200759 Reported-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index b160e98076e3..5005ea40364f 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -195,6 +195,7 @@ void disable_cpufreq(void);
195u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy); 195u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
196int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); 196int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
197void cpufreq_update_policy(unsigned int cpu); 197void cpufreq_update_policy(unsigned int cpu);
198void cpufreq_update_limits(unsigned int cpu);
198bool have_governor_per_policy(void); 199bool have_governor_per_policy(void);
199struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); 200struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
200void cpufreq_enable_fast_switch(struct cpufreq_policy *policy); 201void cpufreq_enable_fast_switch(struct cpufreq_policy *policy);
@@ -322,6 +323,9 @@ struct cpufreq_driver {
322 /* should be defined, if possible */ 323 /* should be defined, if possible */
323 unsigned int (*get)(unsigned int cpu); 324 unsigned int (*get)(unsigned int cpu);
324 325
326 /* Called to update policy limits on firmware notifications. */
327 void (*update_limits)(unsigned int cpu);
328
325 /* optional */ 329 /* optional */
326 int (*bios_limit)(int cpu, unsigned int *limit); 330 int (*bios_limit)(int cpu, unsigned int *limit);
327 331