aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 13:05:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 13:05:22 -0400
commitcf2d213e49fdf47e4c10dc629a3659e0026a54b8 (patch)
treea3a1bded510f0c855a4a9b1c450cf9dd3344ebb7 /include/linux
parent4cdd5f9186bbe80306e76f11da7ecb0b9720433c (diff)
parent586a07dca8c51b966960d1f0d8be9c27d7e0a95c (diff)
Merge tag 'pm-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These update PCI and ACPI power management (improved handling of ACPI power resources and PCIe link delays, fixes related to corner cases, hibernation handling rework), fix and extend the operating performance points (OPP) framework, add new cpufreq drivers for Raspberry Pi and imx8m chips, update some other cpufreq drivers, clean up assorted pieces of PM code and documentation and update tools. Specifics: - Improve the handling of shared ACPI power resources in the PCI bus type layer (Mika Westerberg). - Make the PCI layer take link delays required by the PCIe spec into account as appropriate and avoid polling devices in D3cold for PME (Mika Westerberg). - Fix some corner case issues in ACPI device power management and in the PCI bus type layer, optimiza and clean up the handling of runtime-suspended PCI devices during system-wide transitions to sleep states (Rafael Wysocki). - Rework hibernation handling in the ACPI core and the PCI bus type to resume runtime-suspended devices before hibernation (which allows some functional problems to be avoided) and fix some ACPI power management issues related to hiberation (Rafael Wysocki). - Extend the operating performance points (OPP) framework to support a wider range of devices (Rajendra Nayak, Stehpen Boyd). - Fix issues related to genpd_virt_devs and issues with platforms using the set_opp() callback in the OPP framework (Viresh Kumar, Dmitry Osipenko). - Add new cpufreq driver for Raspberry Pi (Nicolas Saenz Julienne). - Add new cpufreq driver for imx8m and imx7d chips (Leonard Crestez). - Fix and clean up the pcc-cpufreq, brcmstb-avs-cpufreq, s5pv210, and armada-37xx cpufreq drivers (David Arcari, Florian Fainelli, Paweł Chmiel, YueHaibing). - Clean up and fix the cpufreq core (Viresh Kumar, Daniel Lezcano). - Fix minor issue in the ACPI system sleep support code and export one function from it (Lenny Szubowicz, Dexuan Cui). - Clean up assorted pieces of PM code and documentation (Kefeng Wang, Andy Shevchenko, Bart Van Assche, Greg Kroah-Hartman, Fuqian Huang, Geert Uytterhoeven, Mathieu Malaterre, Rafael Wysocki). - Update the pm-graph utility to v5.4 (Todd Brandt). - Fix and clean up the cpupower utility (Abhishek Goel, Nick Black)" * tag 'pm-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (57 commits) ACPI: PM: Make acpi_sleep_state_supported() non-static PM: sleep: Drop dev_pm_skip_next_resume_phases() ACPI: PM: Unexport acpi_device_get_power() Documentation: ABI: power: Add missing newline at end of file ACPI: PM: Drop unused function and function header ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS ACPI: PM: Simplify and fix PM domain hibernation callbacks PCI: PM: Simplify bus-level hibernation callbacks PM: ACPI/PCI: Resume all devices during hibernation cpufreq: Avoid calling cpufreq_verify_current_freq() from handle_update() cpufreq: Consolidate cpufreq_update_current_freq() and __cpufreq_get() kernel: power: swap: use kzalloc() instead of kmalloc() followed by memset() cpufreq: Don't skip frequency validation for has_target() drivers PCI: PM/ACPI: Refresh all stale power state data in pci_pm_complete() PCI / ACPI: Add _PR0 dependent devices ACPI / PM: Introduce concept of a _PR0 dependent device PCI / ACPI: Use cached ACPI device state to get PCI device power state ACPI: PM: Allow transitions to D0 to occur in special cases ACPI: PM: Avoid evaluating _PS3 on transitions from D3hot to D3cold cpufreq: Use has_target() instead of !setpolicy ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h14
-rw-r--r--include/linux/cpufreq.h6
-rw-r--r--include/linux/pm.h1
-rw-r--r--include/linux/pm_opp.h8
-rw-r--r--include/linux/pm_wakeup.h2
-rw-r--r--include/linux/suspend.h5
6 files changed, 16 insertions, 20 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 469be6844703..451e7b544342 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -920,31 +920,21 @@ static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
920#endif 920#endif
921 921
922#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) 922#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
923int acpi_dev_suspend_late(struct device *dev);
924int acpi_subsys_prepare(struct device *dev); 923int acpi_subsys_prepare(struct device *dev);
925void acpi_subsys_complete(struct device *dev); 924void acpi_subsys_complete(struct device *dev);
926int acpi_subsys_suspend_late(struct device *dev); 925int acpi_subsys_suspend_late(struct device *dev);
927int acpi_subsys_suspend_noirq(struct device *dev); 926int acpi_subsys_suspend_noirq(struct device *dev);
928int acpi_subsys_resume_noirq(struct device *dev);
929int acpi_subsys_resume_early(struct device *dev);
930int acpi_subsys_suspend(struct device *dev); 927int acpi_subsys_suspend(struct device *dev);
931int acpi_subsys_freeze(struct device *dev); 928int acpi_subsys_freeze(struct device *dev);
932int acpi_subsys_freeze_late(struct device *dev); 929int acpi_subsys_poweroff(struct device *dev);
933int acpi_subsys_freeze_noirq(struct device *dev);
934int acpi_subsys_thaw_noirq(struct device *dev);
935#else 930#else
936static inline int acpi_dev_resume_early(struct device *dev) { return 0; }
937static inline int acpi_subsys_prepare(struct device *dev) { return 0; } 931static inline int acpi_subsys_prepare(struct device *dev) { return 0; }
938static inline void acpi_subsys_complete(struct device *dev) {} 932static inline void acpi_subsys_complete(struct device *dev) {}
939static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; } 933static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; }
940static inline int acpi_subsys_suspend_noirq(struct device *dev) { return 0; } 934static inline int acpi_subsys_suspend_noirq(struct device *dev) { return 0; }
941static inline int acpi_subsys_resume_noirq(struct device *dev) { return 0; }
942static inline int acpi_subsys_resume_early(struct device *dev) { return 0; }
943static inline int acpi_subsys_suspend(struct device *dev) { return 0; } 935static inline int acpi_subsys_suspend(struct device *dev) { return 0; }
944static inline int acpi_subsys_freeze(struct device *dev) { return 0; } 936static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
945static inline int acpi_subsys_freeze_late(struct device *dev) { return 0; } 937static inline int acpi_subsys_poweroff(struct device *dev) { return 0; }
946static inline int acpi_subsys_freeze_noirq(struct device *dev) { return 0; }
947static inline int acpi_subsys_thaw_noirq(struct device *dev) { return 0; }
948#endif 938#endif
949 939
950#ifdef CONFIG_ACPI 940#ifdef CONFIG_ACPI
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 32a1733014f5..46b167fba155 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -406,6 +406,12 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
406const char *cpufreq_get_current_driver(void); 406const char *cpufreq_get_current_driver(void);
407void *cpufreq_get_driver_data(void); 407void *cpufreq_get_driver_data(void);
408 408
409static inline int cpufreq_thermal_control_enabled(struct cpufreq_driver *drv)
410{
411 return IS_ENABLED(CONFIG_CPU_THERMAL) &&
412 (drv->flags & CPUFREQ_IS_COOLING_DEV);
413}
414
409static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, 415static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
410 unsigned int min, unsigned int max) 416 unsigned int min, unsigned int max)
411{ 417{
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 345d74a727e3..283fb3defe56 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -760,7 +760,6 @@ extern int pm_generic_poweroff_late(struct device *dev);
760extern int pm_generic_poweroff(struct device *dev); 760extern int pm_generic_poweroff(struct device *dev);
761extern void pm_generic_complete(struct device *dev); 761extern void pm_generic_complete(struct device *dev);
762 762
763extern void dev_pm_skip_next_resume_phases(struct device *dev);
764extern bool dev_pm_may_skip_resume(struct device *dev); 763extern bool dev_pm_may_skip_resume(struct device *dev);
765extern bool dev_pm_smart_suspend_and_suspended(struct device *dev); 764extern bool dev_pm_smart_suspend_and_suspended(struct device *dev);
766 765
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index 5f3a1ee9c4c2..af5021f27cb7 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -128,8 +128,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name);
128void dev_pm_opp_put_clkname(struct opp_table *opp_table); 128void dev_pm_opp_put_clkname(struct opp_table *opp_table);
129struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)); 129struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
130void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table); 130void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
131struct opp_table *dev_pm_opp_set_genpd_virt_dev(struct device *dev, struct device *virt_dev, int index); 131struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names);
132void dev_pm_opp_put_genpd_virt_dev(struct opp_table *opp_table, struct device *virt_dev); 132void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
133int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate); 133int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
134int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); 134int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
135int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask); 135int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask);
@@ -292,12 +292,12 @@ static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const
292 292
293static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {} 293static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {}
294 294
295static inline struct opp_table *dev_pm_opp_set_genpd_virt_dev(struct device *dev, struct device *virt_dev, int index) 295static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names)
296{ 296{
297 return ERR_PTR(-ENOTSUPP); 297 return ERR_PTR(-ENOTSUPP);
298} 298}
299 299
300static inline void dev_pm_opp_put_genpd_virt_dev(struct opp_table *opp_table, struct device *virt_dev) {} 300static inline void dev_pm_opp_detach_genpd(struct opp_table *opp_table) {}
301 301
302static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate) 302static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate)
303{ 303{
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index ce57771fab9b..91027602d137 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -36,7 +36,7 @@ struct wake_irq;
36 * @expire_count: Number of times the wakeup source's timeout has expired. 36 * @expire_count: Number of times the wakeup source's timeout has expired.
37 * @wakeup_count: Number of times the wakeup source might abort suspend. 37 * @wakeup_count: Number of times the wakeup source might abort suspend.
38 * @active: Status of the wakeup source. 38 * @active: Status of the wakeup source.
39 * @has_timeout: The wakeup source has been activated with a timeout. 39 * @autosleep_enabled: Autosleep is active, so update @prevent_sleep_time.
40 */ 40 */
41struct wakeup_source { 41struct wakeup_source {
42 const char *name; 42 const char *name;
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index f0d262ad7b78..9c0ad1a3a727 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -304,7 +304,7 @@ static inline bool idle_should_enter_s2idle(void)
304 return unlikely(s2idle_state == S2IDLE_STATE_ENTER); 304 return unlikely(s2idle_state == S2IDLE_STATE_ENTER);
305} 305}
306 306
307extern bool pm_suspend_via_s2idle(void); 307extern bool pm_suspend_default_s2idle(void);
308extern void __init pm_states_init(void); 308extern void __init pm_states_init(void);
309extern void s2idle_set_ops(const struct platform_s2idle_ops *ops); 309extern void s2idle_set_ops(const struct platform_s2idle_ops *ops);
310extern void s2idle_wake(void); 310extern void s2idle_wake(void);
@@ -336,7 +336,7 @@ static inline void pm_set_suspend_via_firmware(void) {}
336static inline void pm_set_resume_via_firmware(void) {} 336static inline void pm_set_resume_via_firmware(void) {}
337static inline bool pm_suspend_via_firmware(void) { return false; } 337static inline bool pm_suspend_via_firmware(void) { return false; }
338static inline bool pm_resume_via_firmware(void) { return false; } 338static inline bool pm_resume_via_firmware(void) { return false; }
339static inline bool pm_suspend_via_s2idle(void) { return false; } 339static inline bool pm_suspend_default_s2idle(void) { return false; }
340 340
341static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} 341static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
342static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } 342static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
@@ -448,6 +448,7 @@ extern bool system_entering_hibernation(void);
448extern bool hibernation_available(void); 448extern bool hibernation_available(void);
449asmlinkage int swsusp_save(void); 449asmlinkage int swsusp_save(void);
450extern struct pbe *restore_pblist; 450extern struct pbe *restore_pblist;
451int pfn_is_nosave(unsigned long pfn);
451#else /* CONFIG_HIBERNATION */ 452#else /* CONFIG_HIBERNATION */
452static inline void register_nosave_region(unsigned long b, unsigned long e) {} 453static inline void register_nosave_region(unsigned long b, unsigned long e) {}
453static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} 454static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}