PM: sleep: Print PM debug messages during hibernation
[ Upstream commit 1b17d4525bca3916644c41e01522df8fa0f8b90b ] Commitcdb8c100d8
("include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume") caused PM debug messages to only be printed during system-wide suspend and resume in progress, but it forgot about hibernation. Address this by adding a check for hibernation in progress to pm_debug_messages_should_print(). Fixes:cdb8c100d8
("include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/4998903.GXAFRqVoOG@rjwysocki.net Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
aa7b90057b
commit
fca08cfadd
@@ -80,6 +80,11 @@ void hibernate_release(void)
|
||||
atomic_inc(&hibernate_atomic);
|
||||
}
|
||||
|
||||
bool hibernation_in_progress(void)
|
||||
{
|
||||
return !atomic_read(&hibernate_atomic);
|
||||
}
|
||||
|
||||
bool hibernation_available(void)
|
||||
{
|
||||
return nohibernate == 0 &&
|
||||
|
@@ -585,7 +585,8 @@ bool pm_debug_messages_on __read_mostly;
|
||||
|
||||
bool pm_debug_messages_should_print(void)
|
||||
{
|
||||
return pm_debug_messages_on && pm_suspend_target_state != PM_SUSPEND_ON;
|
||||
return pm_debug_messages_on && (hibernation_in_progress() ||
|
||||
pm_suspend_target_state != PM_SUSPEND_ON);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pm_debug_messages_should_print);
|
||||
|
||||
|
@@ -66,10 +66,14 @@ extern void enable_restore_image_protection(void);
|
||||
static inline void enable_restore_image_protection(void) {}
|
||||
#endif /* CONFIG_STRICT_KERNEL_RWX */
|
||||
|
||||
extern bool hibernation_in_progress(void);
|
||||
|
||||
#else /* !CONFIG_HIBERNATION */
|
||||
|
||||
static inline void hibernate_reserved_size_init(void) {}
|
||||
static inline void hibernate_image_size_init(void) {}
|
||||
|
||||
static inline bool hibernation_in_progress(void) { return false; }
|
||||
#endif /* !CONFIG_HIBERNATION */
|
||||
|
||||
#define power_attr(_name) \
|
||||
|
Reference in New Issue
Block a user