aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-05-09 15:03:35 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-05-13 21:59:02 +0200
commitf5c0ecf196aaf78777f1606f1e0392c5e57c4530 (patch)
treeff84c74309cd9be028f8e34cd5772dcf45ad61e6 /kernel
parentPM: sleep: Introduce pm_suspend_in_progress() (diff)
downloadlinux-f5c0ecf196aaf78777f1606f1e0392c5e57c4530.tar.gz
linux-f5c0ecf196aaf78777f1606f1e0392c5e57c4530.zip
PM: sleep: Introduce pm_sleep_transition_in_progress()
The "suspend in progress" check in device_wakeup_enable() does not cover hibernation, but arguably it should do that, so introduce pm_sleep_transition_in_progress() covering transitions during both system suspend and hibernation to use in there and use it also in pm_debug_messages_should_print(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/7820474.EvYhyI6sBW@rjwysocki.net [ rjw: Move the new function definition under CONFIG_PM_SLEEP ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 8c26241c6724..8d17de9c8416 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -557,6 +557,10 @@ static int __init pm_debugfs_init(void)
late_initcall(pm_debugfs_init);
#endif /* CONFIG_DEBUG_FS */
+bool pm_sleep_transition_in_progress(void)
+{
+ return pm_suspend_in_progress() || hibernation_in_progress();
+}
#endif /* CONFIG_PM_SLEEP */
#ifdef CONFIG_PM_SLEEP_DEBUG
@@ -613,8 +617,7 @@ bool pm_debug_messages_on __read_mostly;
bool pm_debug_messages_should_print(void)
{
- return pm_debug_messages_on && (pm_suspend_in_progress() ||
- hibernation_in_progress());
+ return pm_debug_messages_on && pm_sleep_transition_in_progress();
}
EXPORT_SYMBOL_GPL(pm_debug_messages_should_print);