From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Vimal Kumar <vimal.kumar32@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / sleep: Mechanism to find source aborting kernel suspend transition
Date: Sat, 9 Dec 2023 16:26:54 +0100 [thread overview]
Message-ID: <7078bc2e-7029-4abe-b970-3a6b83e10c53@wanadoo.fr> (raw)
In-Reply-To: <20231209081056.1497-1-vimal.kumar32@gmail.com>
Le 09/12/2023 à 09:10, Vimal Kumar a écrit :
> Sometimes kernel suspend transitions can be aborted unconditionally by
> manipulating pm_abort_suspend value using "hard" wakeup triggers or
> through "pm_system_wakeup()".
>
> There is no way to trace the source path of module or subsystem which
> aborted the suspend transitions. This change will create a list of
> wakeup sources aborting suspend in progress through "hard" events as
> well as subsytems aborting suspend using "pm_system_wakeup()".
>
> Example: Existing suspend failure logs:
> [ 349.708359] PM: Some devices failed to suspend, or early wake event detected
> [ 350.327842] PM: suspend exit
>
> Suspend failure logs with this change:
> [ 518.761835] PM: Some devices failed to suspend, or early wake event detected
> [ 519.486939] Abort: ws or subsystem uart_suspend_port aborted suspend
> [ 519.500594] PM: suspend exit
>
> Here we can clearly identify the module triggerring abort suspend.
>
> Co-developed-by: Chinmoy Ghosh <chinmoyghosh2001@gmail.com>
> Signed-off-by: Chinmoy Ghosh <chinmoyghosh2001@gmail.com>
> Co-developed-by: Mintu Patel <mintupatel89@gmail.com>
> Signed-off-by: Mintu Patel <mintupatel89@gmail.com>
> Co-developed-by: Vishal Badole <badolevishal1116@gmail.com>
> Signed-off-by: Vishal Badole <badolevishal1116@gmail.com>
> Signed-off-by: Vimal Kumar <vimal.kumar32@gmail.com>
> ---
...
> +void pm_add_abort_suspend_source(const char *source_name)
> +{
> + struct pm_abort_suspend_source *info = NULL;
No need to init.
> +
> + info = kmalloc(sizeof(struct pm_abort_suspend_source), GFP_KERNEL);
Could be sizeof(*info).
> + if (unlikely(!info)) {
> + pr_err("Failed to alloc memory for pm_abort_suspend_source info\n");
No need to log a message if kmalloc() fails, a trace is already logged.
> + return;
> + }
> +
> + /* Initialize the list within the struct if it's not already initialized */
> + if (list_empty(&info->list))
> + INIT_LIST_HEAD(&info->list);
> +
> + info->source_triggering_abort_suspend = kstrdup(source_name, GFP_KERNEL);
> + if (unlikely(!info->source_triggering_abort_suspend)) {
> + pr_err("Failed to get abort_suspend source_name\n");
Same here.
> + kfree(info);
> + return;
> + }
> +
> + list_add_tail(&info->list, &pm_abort_suspend_list);
...
CJ
next prev parent reply other threads:[~2023-12-09 15:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 8:10 [PATCH] PM / sleep: Mechanism to find source aborting kernel suspend transition Vimal Kumar
2023-12-09 9:21 ` Greg Kroah-Hartman
2023-12-09 14:53 ` Vimal Kumar
2023-12-09 15:26 ` Christophe JAILLET [this message]
2023-12-09 17:52 ` kernel test robot
2023-12-09 17:52 ` kernel test robot
2023-12-09 21:24 ` kernel test robot
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=7078bc2e-7029-4abe-b970-3a6b83e10c53@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=vimal.kumar32@gmail.com \
/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