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
506506 int acpi_resources_are_enforced(void);
507507
508508 #ifdef CONFIG_HIBERNATION
509−void __init acpi_no_s4_hw_signature(void);
509+void __init acpi_check_s4_hw_signature(int check);
510510 #endif
511511
512512 #ifdef CONFIG_PM_SLEEP
include/linux/pm.h+53−29
@@ -300,47 +300,59 @@ struct dev_pm_ops { · 299 unmodified lines
300300 int (*runtime_idle)(struct device *dev);
301301 };
302302
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+
303332 #ifdef CONFIG_PM_SLEEP
304333 #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
305− .suspend = suspend_fn, \
306− .resume = resume_fn, \
307− .freeze = suspend_fn, \
308− .thaw = resume_fn, \
309− .poweroff = suspend_fn, \
310− .restore = resume_fn,
334+ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
311335 #else
312336 #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
313337 #endif
314338
315339 #ifdef CONFIG_PM_SLEEP
316340 #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
317− .suspend_late = suspend_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,
341+ LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
323342 #else
324343 #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
325344 #endif
326345
327346 #ifdef CONFIG_PM_SLEEP
328347 #define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
329− .suspend_noirq = suspend_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,
348+ NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
335349 #else
336350 #define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
337351 #endif
338352
339353 #ifdef CONFIG_PM
340354 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
341− .runtime_suspend = suspend_fn, \
342− .runtime_resume = resume_fn, \
343− .runtime_idle = idle_fn,
355+ RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
344356 #else
345357 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
346358 #endif
@@ -349,9 +361,9 @@ struct dev_pm_ops { · 2 unmodified lines
349361 * Use this if you want to use the same suspend and resume callbacks for suspend
350362 * to RAM and hibernation.
351363 */
352−#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
353−const struct dev_pm_ops __maybe_unused name = { \
354− SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
364+#define DEFINE_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
365+static const struct dev_pm_ops name = { \
366+ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
355367 }
356368
357369 /*
@@ -367,17 +379,27 @@ const struct dev_pm_ops __maybe_unused name = { \ · 9 unmodified lines
367379 * .resume_early(), to the same routines as .runtime_suspend() and
368380 * .runtime_resume(), respectively (and analogously for hibernation).
369381 */
382+#define DEFINE_UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
383+static 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) \
390+const 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. */
370395 #define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
371396 const struct dev_pm_ops __maybe_unused name = { \
372397 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
373398 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
374399 }
375400
376−#ifdef CONFIG_PM
377−#define pm_ptr(_ptr) (_ptr)
378−#else
379−#define pm_ptr(_ptr) NULL
380−#endif
401+#define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr))
402+#define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
381403
382404 /*
383405 * PM_EVENT_ messages
@@ -499,6 +521,7 @@ const struct dev_pm_ops __maybe_unused name = { \ · 115 unmodified lines
499521 */
500522
501523 enum rpm_status {
524+ RPM_INVALID = -1,
502525 RPM_ACTIVE = 0,
503526 RPM_RESUMING,
504527 RPM_SUSPENDED,
@@ -612,6 +635,7 @@ struct dev_pm_info { · 107 unmodified lines
612635 unsigned int links_count;
613636 enum rpm_request request;
614637 enum rpm_status runtime_status;
638+ enum rpm_status last_status;
615639 int runtime_error;
616640 int autosuspend_delay;
617641 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
5858 extern void pm_runtime_put_suppliers(struct device *dev);
5959 extern void pm_runtime_new_link(struct device *dev);
6060 extern void pm_runtime_drop_link(struct device_link *link);
61+extern void pm_runtime_release_supplier(struct device_link *link, bool check_idle);
6162
6263 extern int devm_pm_runtime_enable(struct device *dev);
6364
@@ -283,6 +284,8 @@ static inline void pm_runtime_get_suppliers(struct device *dev) {} · 219 unmodified lines
283284 static inline void pm_runtime_put_suppliers(struct device *dev) {}
284285 static inline void pm_runtime_new_link(struct device *dev) {}
285286 static inline void pm_runtime_drop_link(struct device_link *link) {}
287+static inline void pm_runtime_release_supplier(struct device_link *link,
288+ bool check_idle) {}
286289
287290 #endif /* !CONFIG_PM */
288291
include/linux/suspend.h+1−0
@@ -446,6 +446,7 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); · 445 unmodified lines
446446 extern asmlinkage int swsusp_arch_suspend(void);
447447 extern asmlinkage int swsusp_arch_resume(void);
448448
449+extern u32 swsusp_hardware_signature;
449450 extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
450451 extern int hibernate(void);
451452 extern 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