Re: [PATCH 05/19] printk: Add more context to suspend/resume functions

John Ogness
2026-01-30T17:27:30Z

On 2025-12-27, Marcos Paulo de Souza <mpdesouza@suse.com> wrote:
> The new comments clarifies from where the functions are supposed to be
> called.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> ---
> kernel/printk/printk.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 173c14e08afe..85a8b6521d9e 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2734,7 +2734,8 @@ MODULE_PARM_DESC(console_no_auto_verbose, "Disable console loglevel raise to hig
> /**
> * console_suspend_all - suspend the console subsystem
> *
> - * This disables printk() while we go into suspend states
> + * This disables printk() while we go into suspend states. Called by the power
> + * management subsystem.

Since you are touching this comment, I would prefer to make it
technically accurate. It is not printk() that is disabled, it is console
printing that is disabled. Perhaps something like:

* Block all console printing while the system goes into suspend state.
* Called by the power management subsystem.

> */
> void console_suspend_all(void)
> {
> @@ -2766,6 +2767,12 @@ void console_suspend_all(void)
> synchronize_srcu(&console_srcu);
> }
>
> +/**
> + * console_resume_all - resume the console subsystem
> + *
> + * This resumes printk() when the system is being restored. Called by the power
> + * management subsystem.

And something similar here:

* Allow all console printing when the system resumes from suspend. Called by
* the power management system.

> + */
> void console_resume_all(void)
> {
> struct console_flush_type ft;

John Ogness