History

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 ..

Linus Torvalds committed 7 years ago

Commit ef800682 parents 8dcd175 1271d6d69 files · +1921 −558Browse files

Showing the changes to include/linux (8 of 69 files). Show all

Unified · Split

8 files
  1. include/linux/cpufreq.h +26 −22
  2. include/linux/cpuidle.h +3 −5
  3. include/linux/device.h +10 −0
  4. include/linux/platform_data/davinci-cpufreq.h +19 −0
  5. include/linux/pm.h +4 −3
  6. include/linux/pm_domain.h +4 −4
  7. include/linux/pm_opp.h +6 −0
  8. include/linux/pm_runtime.h +2 −0
include/linux/cpufreq.h+26−22
@@ -151,6 +151,9 @@ struct cpufreq_policy { · 150 unmodified lines
151151
152152 /* For cpufreq driver's internal use */
153153 void *driver_data;
154+
155+ /* Pointer to the cooling device if used for thermal mitigation */
156+ struct thermal_cooling_device *cdev;
154157 };
155158
156159 /* Only for ACPI */
@@ -254,20 +257,12 @@ __ATTR(_name, 0644, show_##_name, store_##_name) · 97 unmodified lines
254257 static struct freq_attr _name = \
255258 __ATTR(_name, 0200, NULL, store_##_name)
256259
257−struct 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−
265260 #define define_one_global_ro(_name) \
266−static struct global_attr _name = \
261+static struct kobj_attribute _name = \
267262 __ATTR(_name, 0444, show_##_name, NULL)
268263
269264 #define define_one_global_rw(_name) \
270−static struct global_attr _name = \
265+static struct kobj_attribute _name = \
271266 __ATTR(_name, 0644, show_##_name, store_##_name)
272267
273268
@@ -330,6 +325,8 @@ struct cpufreq_driver { · 56 unmodified lines
330325 /* optional */
331326 int (*bios_limit)(int cpu, unsigned int *limit);
332327
328+ int (*online)(struct cpufreq_policy *policy);
329+ int (*offline)(struct cpufreq_policy *policy);
333330 int (*exit)(struct cpufreq_policy *policy);
334331 void (*stop_cpu)(struct cpufreq_policy *policy);
335332 int (*suspend)(struct cpufreq_policy *policy);
@@ -346,14 +343,15 @@ struct cpufreq_driver { · 10 unmodified lines
346343 };
347344
348345 /* flags */
349−#define CPUFREQ_STICKY (1 << 0) /* driver isn't removed even if
350− all ->init() calls failed */
351−#define CPUFREQ_CONST_LOOPS (1 << 1) /* loops_per_jiffy or other
352− kernel "constants" aren't
353− affected by frequency
354− transitions */
355−#define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume
356− speed mismatches */
346+
347+/* driver isn't removed even if all ->init() calls failed */
348+#define CPUFREQ_STICKY BIT(0)
349+
350+/* loops_per_jiffy or other kernel "constants" aren't affected by frequency transitions */
351+#define CPUFREQ_CONST_LOOPS BIT(1)
352+
353+/* don't warn on suspend/resume speed mismatches */
354+#define CPUFREQ_PM_NO_WARN BIT(2)
357355
358356 /*
359357 * This should be set by platforms having multiple clock-domains, i.e.
@@ -361,14 +359,14 @@ struct cpufreq_driver { · 1 unmodified line
361359 * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same
362360 * governor with different tunables for different clusters.
363361 */
364−#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3)
362+#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY BIT(3)
365363
366364 /*
367365 * Driver will do POSTCHANGE notifications from outside of their ->target()
368366 * routine and so must set cpufreq_driver->flags with this flag, so that core
369367 * can handle them specially.
370368 */
371−#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4)
369+#define CPUFREQ_ASYNC_NOTIFICATION BIT(4)
372370
373371 /*
374372 * Set by drivers which want cpufreq core to check if CPU is running at a
@@ -377,13 +375,19 @@ struct cpufreq_driver { · 2 unmodified lines
377375 * from the table. And if that fails, we will stop further boot process by
378376 * issuing a BUG_ON().
379377 */
380−#define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5)
378+#define CPUFREQ_NEED_INITIAL_FREQ_CHECK BIT(5)
381379
382380 /*
383381 * Set by drivers to disallow use of governors with "dynamic_switching" flag
384382 * set.
385383 */
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)
387391
388392 int cpufreq_register_driver(struct cpufreq_driver *driver_data);
389393 int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
include/linux/cpuidle.h+3−5
@@ -69,11 +69,9 @@ struct cpuidle_state { · 68 unmodified lines
6969
7070 /* Idle State Flags */
7171 #define CPUIDLE_FLAG_NONE (0x00)
72−#define CPUIDLE_FLAG_POLLING (0x01) /* polling state */
73−#define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */
74−#define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */
75−
76−#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
72+#define CPUIDLE_FLAG_POLLING BIT(0) /* polling state */
73+#define CPUIDLE_FLAG_COUPLED BIT(1) /* state applies to multiple cpus */
74+#define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */
7775
7876 struct cpuidle_device_kobj;
7977 struct cpuidle_state_kobj;
include/linux/device.h+10−0
@@ -1165,6 +1165,16 @@ static inline bool device_async_suspend_enabled(struct device *dev) · 1164 unmodified lines
11651165 return !!dev->power.async_suspend;
11661166 }
11671167
1168+static inline bool device_pm_not_required(struct device *dev)
1169+{
1170+ return dev->power.no_pm;
1171+}
1172+
1173+static inline void device_set_pm_not_required(struct device *dev)
1174+{
1175+ dev->power.no_pm = true;
1176+}
1177+
11681178 static inline void dev_pm_syscore_device(struct device *dev, bool val)
11691179 {
11701180 #ifdef CONFIG_PM_SLEEP
include/linux/platform_data/davinci-cpufreq.h+19−0
@@ -0,0 +1,19 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * TI DaVinci CPUFreq platform support.
4+ *
5+ * Copyright (C) 2009 Texas Instruments, Inc. http://www.ti.com/
6+ */
7+
8+#ifndef _MACH_DAVINCI_CPUFREQ_H
9+#define _MACH_DAVINCI_CPUFREQ_H
10+
11+#include <linux/cpufreq.h>
12+
13+struct davinci_cpufreq_config {
14+ struct cpufreq_frequency_table *freq_table;
15+ int (*set_voltage)(unsigned int index);
16+ int (*init)(void);
17+};
18+
19+#endif /* _MACH_DAVINCI_CPUFREQ_H */
include/linux/pm.h+4−3
@@ -592,6 +592,7 @@ struct dev_pm_info { · 591 unmodified lines
592592 bool is_suspended:1; /* Ditto */
593593 bool is_noirq_suspended:1;
594594 bool is_late_suspended:1;
595+ bool no_pm:1;
595596 bool early_init:1; /* Owned by the PM core */
596597 bool direct_complete:1; /* Owned by the PM core */
597598 u32 driver_flags;
@@ -633,9 +634,9 @@ struct dev_pm_info { · 35 unmodified lines
633634 int runtime_error;
634635 int autosuspend_delay;
635636 u64 last_busy;
636− unsigned long active_jiffies;
637− unsigned long suspended_jiffies;
638− unsigned long accounting_timestamp;
637+ u64 active_time;
638+ u64 suspended_time;
639+ u64 accounting_timestamp;
639640 #endif
640641 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
641642 void (*set_latency_tolerance)(struct device *, s32);
include/linux/pm_domain.h+4−4
@@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev); · 270 unmodified lines
271271 struct device *genpd_dev_pm_attach_by_id(struct device *dev,
272272 unsigned int index);
273273 struct device *genpd_dev_pm_attach_by_name(struct device *dev,
274− char *name);
274+ const char *name);
275275 #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
276276 static inline int of_genpd_add_provider_simple(struct device_node *np,
277277 struct generic_pm_domain *genpd)
@@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev, · 46 unmodified lines
324324 }
325325
326326 static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
327− char *name)
327+ const char *name)
328328 {
329329 return NULL;
330330 }
@@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on); · 10 unmodified lines
341341 struct device *dev_pm_domain_attach_by_id(struct device *dev,
342342 unsigned int index);
343343 struct device *dev_pm_domain_attach_by_name(struct device *dev,
344− char *name);
344+ const char *name);
345345 void dev_pm_domain_detach(struct device *dev, bool power_off);
346346 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
347347 #else
@@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev, · 7 unmodified lines
355355 return NULL;
356356 }
357357 static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,
358− char *name)
358+ const char *name)
359359 {
360360 return NULL;
361361 }
include/linux/pm_opp.h+6−0
@@ -334,6 +334,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpuma · 333 unmodified lines
334334 struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev);
335335 struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);
336336 int of_get_required_opp_performance_state(struct device_node *np, int index);
337+void dev_pm_opp_of_register_em(struct cpumask *cpus);
337338 #else
338339 static inline int dev_pm_opp_of_add_table(struct device *dev)
339340 {
@@ -372,6 +373,11 @@ static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) · 32 unmodified lines
372373 {
373374 return NULL;
374375 }
376+
377+static inline void dev_pm_opp_of_register_em(struct cpumask *cpus)
378+{
379+}
380+
375381 static inline int of_get_required_opp_performance_state(struct device_node *np, int index)
376382 {
377383 return -ENOTSUPP;
include/linux/pm_runtime.h+2−0
@@ -113,6 +113,8 @@ static inline bool pm_runtime_is_irq_safe(struct device *dev) · 112 unmodified lines
113113 return dev->power.irq_safe;
114114 }
115115
116+extern u64 pm_runtime_suspended_time(struct device *dev);
117+
116118 #else /* !CONFIG_PM */
117119
118120 static inline bool queue_pm_work(struct work_struct *work) { return false; }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t