aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 15:59:46 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 15:59:46 -0500
commitef8006846a3a97d9d8bf49e63dba948d0d2dbbf0 (patch)
tree5929135c14913ba7aebe538567d0550b80a61d73 /include/linux/cpufreq.h
parent8dcd175bc3d50b78413c56d5b17d4bddd77412ef (diff)
parent1271d6d576b7e7c80519de211f250cfd4eebca1a (diff)
Merge tag 'pm-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These are PM-runtime framework changes to use ktime instead of jiffies for accounting, new PM core flag to mark devices that don't need any form of power management, cpuidle updates including driver API documentation and a new governor, cpufreq updates including a new driver for Armada 8K, thermal cleanups and more, some energy-aware scheduling (EAS) enabling changes, new chips support in the intel_idle and RAPL drivers and assorted cleanups in some other places. Specifics: - Update the PM-runtime framework to use ktime instead of jiffies for accounting (Thara Gopinath, Vincent Guittot) - Optimize the autosuspend code in the PM-runtime framework somewhat (Ladislav Michl) - Add a PM core flag to mark devices that don't need any form of power management (Sudeep Holla) - Introduce driver API documentation for cpuidle and add a new cpuidle governor for tickless systems (Rafael Wysocki) - Add Jacobsville support to the intel_idle driver (Zhang Rui) - Clean up a cpuidle core header file and the cpuidle-dt and ACPI processor-idle drivers (Yangtao Li, Joseph Lo, Yazen Ghannam) - Add new cpufreq driver for Armada 8K (Gregory Clement) - Fix and clean up cpufreq core (Rafael Wysocki, Viresh Kumar, Amit Kucheria) - Add support for light-weight tear-down and bring-up of CPUs to the cpufreq core and use it in the cpufreq-dt driver (Viresh Kumar) - Fix cpu_cooling Kconfig dependencies, add support for CPU cooling auto-registration to the cpufreq core and use it in multiple cpufreq drivers (Amit Kucheria) - Fix some minor issues and do some cleanups in the davinci, e_powersaver, ap806, s5pv210, qcom and kryo cpufreq drivers (Bartosz Golaszewski, Gustavo Silva, Julia Lawall, Paweł Chmiel, Taniya Das, Viresh Kumar) - Add a Hisilicon CPPC quirk to the cppc_cpufreq driver (Xiongfeng Wang) - Clean up the intel_pstate and acpi-cpufreq drivers (Erwan Velu, Rafael Wysocki) - Clean up multiple cpufreq drivers (Yangtao Li) - Update cpufreq-related MAINTAINERS entries (Baruch Siach, Lukas Bulwahn) - Add support for exposing the Energy Model via debugfs and make multiple cpufreq drivers register an Energy Model to support energy-aware scheduling (Quentin Perret, Dietmar Eggemann, Matthias Kaehlcke) - Add Ice Lake mobile and Jacobsville support to the Intel RAPL power-capping driver (Gayatri Kammela, Zhang Rui) - Add a power estimation helper to the operating performance points (OPP) framework and clean up a core function in it (Quentin Perret, Viresh Kumar) - Make minor improvements in the generic power domains (genpd), OPP and system suspend frameworks and in the PM core (Aditya Pakki, Douglas Anderson, Greg Kroah-Hartman, Rafael Wysocki, Yangtao Li)" * tag 'pm-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (80 commits) cpufreq: kryo: Release OPP tables on module removal cpufreq: ap806: add missing of_node_put after of_device_is_available cpufreq: acpi-cpufreq: Report if CPU doesn't support boost technologies cpufreq: Pass updated policy to driver ->setpolicy() callback cpufreq: Fix two debug messages in cpufreq_set_policy() cpufreq: Reorder and simplify cpufreq_update_policy() cpufreq: Add kerneldoc comments for two core functions PM / core: Add support to skip power management in device/driver model cpufreq: intel_pstate: Rework iowait boosting to be less aggressive cpufreq: intel_pstate: Eliminate intel_pstate_get_base_pstate() cpufreq: intel_pstate: Avoid redundant initialization of local vars powercap/intel_rapl: add Ice Lake mobile ACPI / processor: Set P_LVL{2,3} idle state descriptions cpufreq / cppc: Work around for Hisilicon CPPC cpufreq ACPI / CPPC: Add a helper to get desired performance cpufreq: davinci: move configuration to include/linux/platform_data cpufreq: speedstep: convert BUG() to BUG_ON() cpufreq: powernv: fix missing check of return value in init_powernv_pstates() cpufreq: longhaul: remove unneeded semicolon cpufreq: pcc-cpufreq: remove unneeded semicolon ..
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h48
1 files changed, 26 insertions, 22 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c86d6d8bdfed..b160e98076e3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -151,6 +151,9 @@ struct cpufreq_policy {
151 151
152 /* For cpufreq driver's internal use */ 152 /* For cpufreq driver's internal use */
153 void *driver_data; 153 void *driver_data;
154
155 /* Pointer to the cooling device if used for thermal mitigation */
156 struct thermal_cooling_device *cdev;
154}; 157};
155 158
156/* Only for ACPI */ 159/* Only for ACPI */
@@ -254,20 +257,12 @@ __ATTR(_name, 0644, show_##_name, store_##_name)
254static struct freq_attr _name = \ 257static struct freq_attr _name = \
255__ATTR(_name, 0200, NULL, store_##_name) 258__ATTR(_name, 0200, NULL, store_##_name)
256 259
257struct global_attr {
258 struct attribute attr;
259 ssize_t (*show)(struct kobject *kobj,
260 struct attribute *attr, char *buf);
261 ssize_t (*store)(struct kobject *a, struct attribute *b,
262 const char *c, size_t count);
263};
264
265#define define_one_global_ro(_name) \ 260#define define_one_global_ro(_name) \
266static struct global_attr _name = \ 261static struct kobj_attribute _name = \
267__ATTR(_name, 0444, show_##_name, NULL) 262__ATTR(_name, 0444, show_##_name, NULL)
268 263
269#define define_one_global_rw(_name) \ 264#define define_one_global_rw(_name) \
270static struct global_attr _name = \ 265static struct kobj_attribute _name = \
271__ATTR(_name, 0644, show_##_name, store_##_name) 266__ATTR(_name, 0644, show_##_name, store_##_name)
272 267
273 268
@@ -330,6 +325,8 @@ struct cpufreq_driver {
330 /* optional */ 325 /* optional */
331 int (*bios_limit)(int cpu, unsigned int *limit); 326 int (*bios_limit)(int cpu, unsigned int *limit);
332 327
328 int (*online)(struct cpufreq_policy *policy);
329 int (*offline)(struct cpufreq_policy *policy);
333 int (*exit)(struct cpufreq_policy *policy); 330 int (*exit)(struct cpufreq_policy *policy);
334 void (*stop_cpu)(struct cpufreq_policy *policy); 331 void (*stop_cpu)(struct cpufreq_policy *policy);
335 int (*suspend)(struct cpufreq_policy *policy); 332 int (*suspend)(struct cpufreq_policy *policy);
@@ -346,14 +343,15 @@ struct cpufreq_driver {
346}; 343};
347 344
348/* flags */ 345/* flags */
349#define CPUFREQ_STICKY (1 << 0) /* driver isn't removed even if 346
350 all ->init() calls failed */ 347/* driver isn't removed even if all ->init() calls failed */
351#define CPUFREQ_CONST_LOOPS (1 << 1) /* loops_per_jiffy or other 348#define CPUFREQ_STICKY BIT(0)
352 kernel "constants" aren't 349
353 affected by frequency 350/* loops_per_jiffy or other kernel "constants" aren't affected by frequency transitions */
354 transitions */ 351#define CPUFREQ_CONST_LOOPS BIT(1)
355#define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume 352
356 speed mismatches */ 353/* don't warn on suspend/resume speed mismatches */
354#define CPUFREQ_PM_NO_WARN BIT(2)
357 355
358/* 356/*
359 * This should be set by platforms having multiple clock-domains, i.e. 357 * This should be set by platforms having multiple clock-domains, i.e.
@@ -361,14 +359,14 @@ struct cpufreq_driver {
361 * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same 359 * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same
362 * governor with different tunables for different clusters. 360 * governor with different tunables for different clusters.
363 */ 361 */
364#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) 362#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY BIT(3)
365 363
366/* 364/*
367 * Driver will do POSTCHANGE notifications from outside of their ->target() 365 * Driver will do POSTCHANGE notifications from outside of their ->target()
368 * routine and so must set cpufreq_driver->flags with this flag, so that core 366 * routine and so must set cpufreq_driver->flags with this flag, so that core
369 * can handle them specially. 367 * can handle them specially.
370 */ 368 */
371#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) 369#define CPUFREQ_ASYNC_NOTIFICATION BIT(4)
372 370
373/* 371/*
374 * Set by drivers which want cpufreq core to check if CPU is running at a 372 * Set by drivers which want cpufreq core to check if CPU is running at a
@@ -377,13 +375,19 @@ struct cpufreq_driver {
377 * from the table. And if that fails, we will stop further boot process by 375 * from the table. And if that fails, we will stop further boot process by
378 * issuing a BUG_ON(). 376 * issuing a BUG_ON().
379 */ 377 */
380#define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5) 378#define CPUFREQ_NEED_INITIAL_FREQ_CHECK BIT(5)
381 379
382/* 380/*
383 * Set by drivers to disallow use of governors with "dynamic_switching" flag 381 * Set by drivers to disallow use of governors with "dynamic_switching" flag
384 * set. 382 * set.
385 */ 383 */
386#define CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING (1 << 6) 384#define CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING BIT(6)
385
386/*
387 * Set by drivers that want the core to automatically register the cpufreq
388 * driver as a thermal cooling device.
389 */
390#define CPUFREQ_IS_COOLING_DEV BIT(7)
387 391
388int cpufreq_register_driver(struct cpufreq_driver *driver_data); 392int cpufreq_register_driver(struct cpufreq_driver *driver_data);
389int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 393int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);