summaryrefslogtreecommitdiff
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-08-22 13:18:17 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-09-07 21:53:48 +0200
commit5950e5d574c636a07dd21a872c2f8b41f6d20c55 (patch)
tree77419bad4e34bcffa13046fc8c673b67276ccd7b /include/linux/suspend.h
parent0b9d46fc5ef7a457cc635b30b010081228cb81ac (diff)
freezer: Have {,un}lock_system_sleep() save/restore flags
Rafael explained that the reason for having both PF_NOFREEZE and PF_FREEZER_SKIP is that {,un}lock_system_sleep() is callable from kthread context that has previously called set_freezable(). In preparation of merging the flags, have {,un}lock_system_slee() save and restore current->flags. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20220822114648.725003428@infradead.org
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 70f2921e2e70..34fb72c0db85 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -510,8 +510,8 @@ extern bool pm_save_wakeup_count(unsigned int count);
extern void pm_wakep_autosleep_enabled(bool set);
extern void pm_print_active_wakeup_sources(void);
-extern void lock_system_sleep(void);
-extern void unlock_system_sleep(void);
+extern unsigned int lock_system_sleep(void);
+extern void unlock_system_sleep(unsigned int);
#else /* !CONFIG_PM_SLEEP */
@@ -534,8 +534,8 @@ static inline void pm_system_wakeup(void) {}
static inline void pm_wakeup_clear(bool reset) {}
static inline void pm_system_irq_wakeup(unsigned int irq_number) {}
-static inline void lock_system_sleep(void) {}
-static inline void unlock_system_sleep(void) {}
+static inline unsigned int lock_system_sleep(void) { return 0; }
+static inline void unlock_system_sleep(unsigned int flags) {}
#endif /* !CONFIG_PM_SLEEP */