History

Merge branches 'pm-cpuidle', 'pm-core' and 'pm-sleep'

Merge cpuidle updates, PM core updates and one hiberation-related update for 5.17-rc1: - Make cpuidle use default_groups in kobj_type (Greg Kroah-Hartman). - Fix two comments in cpuidle code (Jason Wang, Yang Li). - Simplify locking in pm_runtime_put_suppliers() (Rafael Wysocki). - Add safety net to supplier device release in the runtime PM core code (Rafael Wysocki). - Capture device status before disabling runtime PM for it (Rafael Wysocki). - Add new macros for declaring PM operations to allow drivers to avoid guarding them with CONFIG_PM #ifdefs or __maybe_unused and update some drivers to use these macros (Paul Cercueil). - Allow ACPI hardware signature to be honoured during restore from hibernation (David Woodhouse). * pm-cpuidle: cpuidle: use default_groups in kobj_type cpuidle: Fix cpuidle_remove_state_sysfs() kerneldoc comment cpuidle: menu: Fix typo in a comment * pm-core: PM: runtime: Simplify locking in pm_runtime_put_suppliers() mmc: mxc: Use the new PM macros mmc: jz4740: Use the new PM macros PM: runtime: Add safety net to supplier device release PM: runtime: Capture device status before disabling runtime PM PM: core: Add new *_PM_OPS macros, deprecate old ones PM: core: Redefine pm_ptr() macro r8169: Avoid misuse of pm_ptr() macro * pm-sleep: PM: hibernate: Allow ACPI hardware signature to be honoured

Rafael J. Wysocki committed 4 years ago

Commit c001a524 parents 5561f25 7dfc5b6 50a4606 74d955517 files · +198 −95Browse files

Showing the changes to include (4 of 17 files). Show all

Unified · Split

4 files
  1. include/linux/acpi.h +1 −1
  2. include/linux/pm.h +53 −29
  3. include/linux/pm_runtime.h +3 −0
  4. include/linux/suspend.h +1 −0
include/linux/acpi.h+1−1
@@ -506,7 +506,7 @@ acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, · 505 unmodified lines
506int acpi_resources_are_enforced(void);506int acpi_resources_are_enforced(void);
507 507
508#ifdef CONFIG_HIBERNATION508#ifdef CONFIG_HIBERNATION
509void __init acpi_no_s4_hw_signature(void);509void __init acpi_check_s4_hw_signature(int check);
510#endif510#endif
511 511
512#ifdef CONFIG_PM_SLEEP512#ifdef CONFIG_PM_SLEEP
include/linux/pm.h+53−29
@@ -300,47 +300,59 @@ struct dev_pm_ops { · 299 unmodified lines
300 int (*runtime_idle)(struct device *dev);300 int (*runtime_idle)(struct device *dev);
301};301};
302 302
303#define SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
304 .suspend = pm_sleep_ptr(suspend_fn), \
305 .resume = pm_sleep_ptr(resume_fn), \
306 .freeze = pm_sleep_ptr(suspend_fn), \
307 .thaw = pm_sleep_ptr(resume_fn), \
308 .poweroff = pm_sleep_ptr(suspend_fn), \
309 .restore = pm_sleep_ptr(resume_fn),
310
311#define LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
312 .suspend_late = pm_sleep_ptr(suspend_fn), \
313 .resume_early = pm_sleep_ptr(resume_fn), \
314 .freeze_late = pm_sleep_ptr(suspend_fn), \
315 .thaw_early = pm_sleep_ptr(resume_fn), \
316 .poweroff_late = pm_sleep_ptr(suspend_fn), \
317 .restore_early = pm_sleep_ptr(resume_fn),
318
319#define NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
320 .suspend_noirq = pm_sleep_ptr(suspend_fn), \
321 .resume_noirq = pm_sleep_ptr(resume_fn), \
322 .freeze_noirq = pm_sleep_ptr(suspend_fn), \
323 .thaw_noirq = pm_sleep_ptr(resume_fn), \
324 .poweroff_noirq = pm_sleep_ptr(suspend_fn), \
325 .restore_noirq = pm_sleep_ptr(resume_fn),
326
327#define RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
328 .runtime_suspend = suspend_fn, \
329 .runtime_resume = resume_fn, \
330 .runtime_idle = idle_fn,
331
303#ifdef CONFIG_PM_SLEEP332#ifdef CONFIG_PM_SLEEP
304#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \333#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
305 .suspend = suspend_fn, \334 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
306 .resume = resume_fn, \
307 .freeze = suspend_fn, \
308 .thaw = resume_fn, \
309 .poweroff = suspend_fn, \
310 .restore = resume_fn,
311#else335#else
312#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)336#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
313#endif337#endif
314 338
315#ifdef CONFIG_PM_SLEEP339#ifdef CONFIG_PM_SLEEP
316#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \340#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
317 .suspend_late = suspend_fn, \341 LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
318 .resume_early = resume_fn, \
319 .freeze_late = suspend_fn, \
320 .thaw_early = resume_fn, \
321 .poweroff_late = suspend_fn, \
322 .restore_early = resume_fn,
323#else342#else
324#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)343#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
325#endif344#endif
326 345
327#ifdef CONFIG_PM_SLEEP346#ifdef CONFIG_PM_SLEEP
328#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \347#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
329 .suspend_noirq = suspend_fn, \348 NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
330 .resume_noirq = resume_fn, \
331 .freeze_noirq = suspend_fn, \
332 .thaw_noirq = resume_fn, \
333 .poweroff_noirq = suspend_fn, \
334 .restore_noirq = resume_fn,
335#else349#else
336#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)350#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
337#endif351#endif
338 352
339#ifdef CONFIG_PM353#ifdef CONFIG_PM
340#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \354#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
341 .runtime_suspend = suspend_fn, \355 RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
342 .runtime_resume = resume_fn, \
343 .runtime_idle = idle_fn,
344#else356#else
345#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)357#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
346#endif358#endif
@@ -349,9 +361,9 @@ struct dev_pm_ops { · 2 unmodified lines
349 * Use this if you want to use the same suspend and resume callbacks for suspend361 * Use this if you want to use the same suspend and resume callbacks for suspend
350 * to RAM and hibernation.362 * to RAM and hibernation.
351 */363 */
352#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \364#define DEFINE_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
353const struct dev_pm_ops __maybe_unused name = { \365static const struct dev_pm_ops name = { \
354 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \366 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
355}367}
356 368
357/*369/*
@@ -367,17 +379,27 @@ const struct dev_pm_ops __maybe_unused name = { \ · 9 unmodified lines
367 * .resume_early(), to the same routines as .runtime_suspend() and379 * .resume_early(), to the same routines as .runtime_suspend() and
368 * .runtime_resume(), respectively (and analogously for hibernation).380 * .runtime_resume(), respectively (and analogously for hibernation).
369 */381 */
382#define DEFINE_UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
383static const struct dev_pm_ops name = { \
384 SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
385 RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
386}
387
388/* Deprecated. Use DEFINE_SIMPLE_DEV_PM_OPS() instead. */
389#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
390const struct dev_pm_ops __maybe_unused name = { \
391 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
392}
393
394/* Deprecated. Use DEFINE_UNIVERSAL_DEV_PM_OPS() instead. */
370#define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \395#define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
371const struct dev_pm_ops __maybe_unused name = { \396const struct dev_pm_ops __maybe_unused name = { \
372 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \397 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
373 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \398 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
374}399}
375 400
376#ifdef CONFIG_PM401#define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr))
377#define pm_ptr(_ptr) (_ptr)402#define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
378#else
379#define pm_ptr(_ptr) NULL
380#endif
381 403
382/*404/*
383 * PM_EVENT_ messages405 * PM_EVENT_ messages
@@ -499,6 +521,7 @@ const struct dev_pm_ops __maybe_unused name = { \ · 115 unmodified lines
499 */521 */
500 522
501enum rpm_status {523enum rpm_status {
524 RPM_INVALID = -1,
502 RPM_ACTIVE = 0,525 RPM_ACTIVE = 0,
503 RPM_RESUMING,526 RPM_RESUMING,
504 RPM_SUSPENDED,527 RPM_SUSPENDED,
@@ -612,6 +635,7 @@ struct dev_pm_info { · 107 unmodified lines
612 unsigned int links_count;635 unsigned int links_count;
613 enum rpm_request request;636 enum rpm_request request;
614 enum rpm_status runtime_status;637 enum rpm_status runtime_status;
638 enum rpm_status last_status;
615 int runtime_error;639 int runtime_error;
616 int autosuspend_delay;640 int autosuspend_delay;
617 u64 last_busy;641 u64 last_busy;
include/linux/pm_runtime.h+3−0
@@ -58,6 +58,7 @@ extern void pm_runtime_get_suppliers(struct device *dev); · 57 unmodified lines
58extern void pm_runtime_put_suppliers(struct device *dev);58extern void pm_runtime_put_suppliers(struct device *dev);
59extern void pm_runtime_new_link(struct device *dev);59extern void pm_runtime_new_link(struct device *dev);
60extern void pm_runtime_drop_link(struct device_link *link);60extern void pm_runtime_drop_link(struct device_link *link);
61extern void pm_runtime_release_supplier(struct device_link *link, bool check_idle);
61 62
62extern int devm_pm_runtime_enable(struct device *dev);63extern int devm_pm_runtime_enable(struct device *dev);
63 64
@@ -283,6 +284,8 @@ static inline void pm_runtime_get_suppliers(struct device *dev) {} · 219 unmodified lines
283static inline void pm_runtime_put_suppliers(struct device *dev) {}284static inline void pm_runtime_put_suppliers(struct device *dev) {}
284static inline void pm_runtime_new_link(struct device *dev) {}285static inline void pm_runtime_new_link(struct device *dev) {}
285static inline void pm_runtime_drop_link(struct device_link *link) {}286static inline void pm_runtime_drop_link(struct device_link *link) {}
287static inline void pm_runtime_release_supplier(struct device_link *link,
288 bool check_idle) {}
286 289
287#endif /* !CONFIG_PM */290#endif /* !CONFIG_PM */
288 291
include/linux/suspend.h+1−0
@@ -446,6 +446,7 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); · 445 unmodified lines
446extern asmlinkage int swsusp_arch_suspend(void);446extern asmlinkage int swsusp_arch_suspend(void);
447extern asmlinkage int swsusp_arch_resume(void);447extern asmlinkage int swsusp_arch_resume(void);
448 448
449extern u32 swsusp_hardware_signature;
449extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);450extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
450extern int hibernate(void);451extern int hibernate(void);
451extern bool system_entering_hibernation(void);452extern bool system_entering_hibernation(void);

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