From: xiongxin <xiongxin@kylinos.cn>
To: rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz,
mario.limonciello@amd.com
Cc: linux-pm@vger.kernel.org, xiongxin <xiongxin@kylinos.cn>
Subject: [PATCH] Revert "include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume"
Date: Mon, 22 Apr 2024 17:36:19 +0800 [thread overview]
Message-ID: <20240422093619.118278-1-xiongxin@kylinos.cn> (raw)
This reverts commit cdb8c100d8a4b4e31c829724e40b4fdf32977cce.
In the suspend process, pm_pr_dbg() is called before setting
pm_suspend_target_state. As a result, this part of the log cannot be
output.
pm_pr_dbg() also outputs debug logs for hibernate, but
pm_suspend_target_state is not set, resulting in hibernate debug logs
can only be output through dynamic debug, which is very inconvenient.
Signed-off-by: xiongxin <xiongxin@kylinos.cn>
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index da6ebca3ff77..415483b89b11 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -503,7 +503,6 @@ static inline void unlock_system_sleep(unsigned int flags) {}
#ifdef CONFIG_PM_SLEEP_DEBUG
extern bool pm_print_times_enabled;
extern bool pm_debug_messages_on;
-extern bool pm_debug_messages_should_print(void);
static inline int pm_dyn_debug_messages_on(void)
{
#ifdef CONFIG_DYNAMIC_DEBUG
@@ -517,14 +516,14 @@ static inline int pm_dyn_debug_messages_on(void)
#endif
#define __pm_pr_dbg(fmt, ...) \
do { \
- if (pm_debug_messages_should_print()) \
+ if (pm_debug_messages_on) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
else if (pm_dyn_debug_messages_on()) \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
#define __pm_deferred_pr_dbg(fmt, ...) \
do { \
- if (pm_debug_messages_should_print()) \
+ if (pm_debug_messages_on) \
printk_deferred(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
} while (0)
#else
@@ -542,8 +541,7 @@ static inline int pm_dyn_debug_messages_on(void)
/**
* pm_pr_dbg - print pm sleep debug messages
*
- * If pm_debug_messages_on is enabled and the system is entering/leaving
- * suspend, print message.
+ * If pm_debug_messages_on is enabled, print message.
* If pm_debug_messages_on is disabled and CONFIG_DYNAMIC_DEBUG is enabled,
* print message only from instances explicitly enabled on dynamic debug's
* control.
diff --git a/kernel/power/main.c b/kernel/power/main.c
index a9e0693aaf69..aa754241aaa6 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -611,12 +611,6 @@ power_attr_ro(pm_wakeup_irq);
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;
-}
-EXPORT_SYMBOL_GPL(pm_debug_messages_should_print);
-
static ssize_t pm_debug_messages_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
--
2.34.1
next reply other threads:[~2024-04-22 9:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 9:36 xiongxin [this message]
2024-04-22 14:33 ` [PATCH] Revert "include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume" Mario Limonciello
2024-04-22 14:45 ` Rafael J. Wysocki
2024-04-22 15:01 ` Mario Limonciello
2024-04-22 15:18 ` Rafael J. Wysocki
2024-04-22 15:25 ` Mario Limonciello
2024-04-22 15:43 ` Rafael J. Wysocki
2024-04-22 15:54 ` Mario Limonciello
2024-04-22 16:04 ` Rafael J. Wysocki
2024-04-23 0:59 ` xiongxin
2024-04-23 3:42 ` Mario Limonciello
2024-04-23 8:17 ` [PATCH] PM: sleep: Optimize the pm_debug_messages_should_print() function xiongxin
2024-04-23 16:52 ` Mario Limonciello
2024-04-30 8:45 ` xiongxin
2024-04-30 14:36 ` Mario Limonciello
2024-05-01 4:45 ` xiongxin
2024-05-02 19:04 ` Mario Limonciello
[not found] ` <1714698149088349.0.seg@mailgw.kylinos.cn>
2024-05-03 1:29 ` xiongxin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240422093619.118278-1-xiongxin@kylinos.cn \
--to=xiongxin@kylinos.cn \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).