summaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-06 22:40:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-06 22:40:31 -0400
commit8f5e823f9131a430b12f73e9436d7486e20c16f5 (patch)
treeec3f03c236182d113dd71b1b7b59be73e54ebab1 /include/linux/cpufreq.h
parent59df1c2bdecb0d1aaadfb8533df4bea528ee4952 (diff)
parente07095c9bbcd296401bec8b6852d258d7c926969 (diff)
Merge tag 'pm-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These fix the (Intel-specific) Performance and Energy Bias Hint (EPB) handling and expose it to user space via sysfs, fix and clean up several cpufreq drivers, add support for two new chips to the qoriq cpufreq driver, fix, simplify and clean up the cpufreq core and the schedutil governor, add support for "CPU" domains to the generic power domains (genpd) framework and provide low-level PSCI firmware support for that feature, fix the exynos cpuidle driver and fix a couple of issues in the devfreq subsystem and clean it up. Specifics: - Fix the handling of Performance and Energy Bias Hint (EPB) on Intel processors and expose it to user space via sysfs to avoid having to access it through the generic MSR I/F (Rafael Wysocki). - Improve the handling of global turbo changes made by the platform firmware in the intel_pstate driver (Rafael Wysocki). - Convert some slow-path static_cpu_has() callers to boot_cpu_has() in cpufreq (Borislav Petkov). - Fix the frequency calculation loop in the armada-37xx cpufreq driver (Gregory CLEMENT). - Fix possible object reference leaks in multuple cpufreq drivers (Wen Yang). - Fix kerneldoc comment in the centrino cpufreq driver (dongjian). - Clean up the ACPI and maple cpufreq drivers (Viresh Kumar, Mohan Kumar). - Add support for lx2160a and ls1028a to the qoriq cpufreq driver (Vabhav Sharma, Yuantian Tang). - Fix kobject memory leak in the cpufreq core (Viresh Kumar). - Simplify the IOwait boosting in the schedutil cpufreq governor and rework the TSC cpufreq notifier on x86 (Rafael Wysocki). - Clean up the cpufreq core and statistics code (Yue Hu, Kyle Lin). - Improve the cpufreq documentation, add SPDX license tags to some PM documentation files and unify copyright notices in them (Rafael Wysocki). - Add support for "CPU" domains to the generic power domains (genpd) framework and provide low-level PSCI firmware support for that feature (Ulf Hansson). - Rearrange the PSCI firmware support code and add support for SYSTEM_RESET2 to it (Ulf Hansson, Sudeep Holla). - Improve genpd support for devices in multiple power domains (Ulf Hansson). - Unify target residency for the AFTR and coupled AFTR states in the exynos cpuidle driver (Marek Szyprowski). - Introduce new helper routine in the operating performance points (OPP) framework (Andrew-sh.Cheng). - Add support for passing on-die termination (ODT) and auto power down parameters from the kernel to Trusted Firmware-A (TF-A) to the rk3399_dmc devfreq driver (Enric Balletbo i Serra). - Add tracing to devfreq (Lukasz Luba). - Make the exynos-bus devfreq driver suspend all devices on system shutdown (Marek Szyprowski). - Fix a few minor issues in the devfreq subsystem and clean it up somewhat (Enric Balletbo i Serra, MyungJoo Ham, Rob Herring, Saravana Kannan, Yangtao Li). - Improve system wakeup diagnostics (Stephen Boyd). - Rework filesystem sync messages emitted during system suspend and hibernation (Harry Pan)" * tag 'pm-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (72 commits) cpufreq: Fix kobject memleak cpufreq: armada-37xx: fix frequency calculation for opp cpufreq: centrino: Fix centrino_setpolicy() kerneldoc comment cpufreq: qoriq: add support for lx2160a x86: tsc: Rework time_cpufreq_notifier() PM / Domains: Allow to attach a CPU via genpd_dev_pm_attach_by_id|name() PM / Domains: Search for the CPU device outside the genpd lock PM / Domains: Drop unused in-parameter to some genpd functions PM / Domains: Use the base device for driver_deferred_probe_check_state() cpufreq: qoriq: Add ls1028a chip support PM / Domains: Enable genpd_dev_pm_attach_by_id|name() for single PM domain PM / Domains: Allow OF lookup for multi PM domain case from ->attach_dev() PM / Domains: Don't kfree() the virtual device in the error path cpufreq: Move ->get callback check outside of __cpufreq_get() PM / Domains: remove unnecessary unlikely() cpufreq: Remove needless bios_limit check in show_bios_limit() drivers/cpufreq/acpi-cpufreq.c: This fixes the following checkpatch warning firmware/psci: add support for SYSTEM_RESET2 PM / devfreq: add tracing for scheduling work trace: events: add devfreq trace event file ...
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index b160e98076e3..684caf067003 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -178,6 +178,11 @@ static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
178static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { } 178static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
179#endif 179#endif
180 180
181static inline bool policy_is_inactive(struct cpufreq_policy *policy)
182{
183 return cpumask_empty(policy->cpus);
184}
185
181static inline bool policy_is_shared(struct cpufreq_policy *policy) 186static inline bool policy_is_shared(struct cpufreq_policy *policy)
182{ 187{
183 return cpumask_weight(policy->cpus) > 1; 188 return cpumask_weight(policy->cpus) > 1;
@@ -193,8 +198,14 @@ unsigned int cpufreq_quick_get_max(unsigned int cpu);
193void disable_cpufreq(void); 198void disable_cpufreq(void);
194 199
195u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy); 200u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
201
202struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu);
203void cpufreq_cpu_release(struct cpufreq_policy *policy);
196int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); 204int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
205int cpufreq_set_policy(struct cpufreq_policy *policy,
206 struct cpufreq_policy *new_policy);
197void cpufreq_update_policy(unsigned int cpu); 207void cpufreq_update_policy(unsigned int cpu);
208void cpufreq_update_limits(unsigned int cpu);
198bool have_governor_per_policy(void); 209bool have_governor_per_policy(void);
199struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); 210struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
200void cpufreq_enable_fast_switch(struct cpufreq_policy *policy); 211void cpufreq_enable_fast_switch(struct cpufreq_policy *policy);
@@ -322,6 +333,9 @@ struct cpufreq_driver {
322 /* should be defined, if possible */ 333 /* should be defined, if possible */
323 unsigned int (*get)(unsigned int cpu); 334 unsigned int (*get)(unsigned int cpu);
324 335
336 /* Called to update policy limits on firmware notifications. */
337 void (*update_limits)(unsigned int cpu);
338
325 /* optional */ 339 /* optional */
326 int (*bios_limit)(int cpu, unsigned int *limit); 340 int (*bios_limit)(int cpu, unsigned int *limit);
327 341