public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: xiongxin <xiongxin@kylinos.cn>
To: Mario Limonciello <mario.limonciello@amd.com>, rafael@kernel.org
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] PM: sleep: Optimize the pm_debug_messages_should_print() function
Date: Tue, 30 Apr 2024 16:45:35 +0800	[thread overview]
Message-ID: <408bbf09-58ef-4d55-ba89-a64dbce25085@kylinos.cn> (raw)
In-Reply-To: <2f07ea21-c89b-49dc-a7b6-8c4e207d1af7@amd.com>


在 2024/4/24 00:52, Mario Limonciello 写道:
> On 4/23/2024 03:17, xiongxin wrote:
>> commit cdb8c100d8a4 ("include/linux/suspend.h: Only show pm_pr_dbg
>> messages at suspend/resume"), pm_debug_messages_should_print() is
>> implemented to determine the output of pm_pr_dbg(), using
>> pm_suspend_target_state to identify the suspend process. However, this
>> limits the output range of pm_pr_dbg().
>>
>> 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.
>>
>> Currently, remove pm_suspend_target_state from
>> pm_debug_messages_should_print() to ensure that sleep and hibernate main
>> logic can output debug normally.
>>
>> Fixes: cdb8c100d8a4 ("include/linux/suspend.h: Only show pm_pr_dbg 
>> messages at suspend/resume").
>> Signed-off-by: xiongxin <xiongxin@kylinos.cn>
>> ---
>> v2:
>>     * Resolve the compilation error and re-submit with the fix
>>       patch.
>> v1:
>>     * Revert the commit cdb8c100d8a4 ("include/linux/suspend.h: Only
>>       show pm_pr_dbg messages at suspend/resume").
>> ---
>>
>> diff --git a/kernel/power/main.c b/kernel/power/main.c
>> index a9e0693aaf69..24693599c0bc 100644
>> --- a/kernel/power/main.c
>> +++ b/kernel/power/main.c
>> @@ -613,7 +613,7 @@ 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;
>>   }
>>   EXPORT_SYMBOL_GPL(pm_debug_messages_should_print);
>
> Did you miss the proposal for fixing this for hibernate by adding the 
> extra variable to monitor?

Can I change pm_pr_dbg() in amd_pmc_idlemask_read() to pr_debug() based on

pm_debug_messages_on condition?

I suggest not adding a new variable to this.


  reply	other threads:[~2024-04-30  8:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  9:36 [PATCH] Revert "include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume" xiongxin
2024-04-22 14:33 ` 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 [this message]
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
2024-06-17  6:54             ` 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=408bbf09-58ef-4d55-ba89-a64dbce25085@kylinos.cn \
    --to=xiongxin@kylinos.cn \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --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