From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: igt-dev@lists.freedesktop.org, badal.nilawar@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t v4 2/2] lib/igt_aux: Enable PM Suspend dbg messages
Date: Mon, 26 Jun 2023 15:52:11 -0700 [thread overview]
Message-ID: <874jmtdeg4.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230626125045.3699311-3-anshuman.gupta@intel.com>
On Mon, 26 Jun 2023 05:50:45 -0700, Anshuman Gupta wrote:
>
Hi Anshuman,
> Enabling PM Suspend dbg messages by turning on
> /sys/power/pm_debug_messages switch also adding an
> exit handler provision to restore the
> pm_debug_messages state.
>
> v2:
> - Fixed sysfs_fd leak. [Badal]
> v3:
> - Added igt_aux_enable_pm_suspend_dbg() function doc. [Kmail]
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
> lib/igt_aux.c | 35 ++++++++++++++++++++++++++++-------
> 1 file changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index 5eb6d9e270..35263b4519 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -703,6 +703,7 @@ void igt_print_activity(void)
>
> static int autoresume_delay;
> bool __console_suspend_saved_state;
> +bool __pm_debug_messages_state;
>
> #define SYSFS_MODULE_PRINTK "/sys/module/printk/parameters/"
> #define CONSOLE_SUSPEND_DISABLE false
> @@ -913,7 +914,7 @@ static bool is_mem_sleep_state_supported(int power_dir, enum igt_mem_sleep state
>
> static void igt_aux_pm_suspend_dbg_restore_exit_handler(int sig)
> {
> - int sysfs_fd;
> + int sysfs_fd, power_dir;
>
> sysfs_fd = open(SYSFS_MODULE_PRINTK, O_RDONLY);
>
> @@ -922,17 +923,30 @@ static void igt_aux_pm_suspend_dbg_restore_exit_handler(int sig)
>
> igt_sysfs_set_boolean(sysfs_fd, "console_suspend", __console_suspend_saved_state);
> close(sysfs_fd);
Maybe add an empty line here.
> + power_dir = open("/sys/power", O_RDONLY);
> +
And delete this empty line.
> + if (power_dir < 0)
> + return;
> +
> + if (!faccessat(power_dir, "pm_debug_messages", R_OK | W_OK, 0))
> + igt_sysfs_set_boolean(power_dir, "pm_debug_messages", __pm_debug_messages_state);
> +
> + close(power_dir);
> }
>
> /**
> * igt_aux_enable_pm_suspend_dbg:
> + * @power_dir: /sys/power/ dir fd
> *
> * Enhance the System wide suspend/resume debugging by,
No comma needed (it's from previous patch).
Apart from above nits, lgtm:
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
next prev parent reply other threads:[~2023-06-26 22:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 12:50 [igt-dev] [PATCH i-g-t v4 0/2] PM Suspend debug Anshuman Gupta
2023-06-26 12:50 ` [igt-dev] [PATCH i-g-t v4 1/2] lib/igt_aux: Disable console suspend for suspend test Anshuman Gupta
2023-06-26 12:50 ` [igt-dev] [PATCH i-g-t v4 2/2] lib/igt_aux: Enable PM Suspend dbg messages Anshuman Gupta
2023-06-26 22:52 ` Dixit, Ashutosh [this message]
2023-06-26 14:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for PM Suspend debug (rev5) Patchwork
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=874jmtdeg4.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=igt-dev@lists.freedesktop.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