All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v4 0/2] PM Suspend debug
@ 2023-06-26 12:50 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
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anshuman Gupta @ 2023-06-26 12:50 UTC (permalink / raw)
  To: igt-dev; +Cc: badal.nilawar

This series enhance PM Suspend/Resume debug.

1. Disables console_suspend. 
   v1: https://patchwork.freedesktop.org/series/114517/
2. Enables /sys/power/pm_debug_messages.

Anshuman Gupta (2):
  lib/igt_aux: Disable console suspend for suspend test
  lib/igt_aux: Enable PM Suspend dbg messages

 lib/igt_aux.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [igt-dev] [PATCH i-g-t v4 1/2] lib/igt_aux: Disable console suspend for suspend test
  2023-06-26 12:50 [igt-dev] [PATCH i-g-t v4 0/2] PM Suspend debug Anshuman Gupta
@ 2023-06-26 12:50 ` 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 14:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for PM Suspend debug (rev5) Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Anshuman Gupta @ 2023-06-26 12:50 UTC (permalink / raw)
  To: igt-dev; +Cc: badal.nilawar

We need no_console_suspend to be enable in order to dump the suspend
logs over serial console before attempting the suspend during
CI Execution.
Therefore disable the console_suspend using printk module parameters
while executing suspend test.

v2:
- Keep console_suspend restore only in exit handler. [Ashutosh]
- Don't skip the test on open error, while opening printk parameters,
  instead print warning. [Kmail]
v3:
- Fixed cosmetics and return value comment. [Ashutosh]
v4:
- 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>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/igt_aux.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 386e257834..5eb6d9e270 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -702,6 +702,10 @@ void igt_print_activity(void)
 }
 
 static int autoresume_delay;
+bool __console_suspend_saved_state;
+
+#define SYSFS_MODULE_PRINTK "/sys/module/printk/parameters/"
+#define CONSOLE_SUSPEND_DISABLE false
 
 static const char *suspend_state_name[] = {
 	[SUSPEND_STATE_FREEZE] = "freeze",
@@ -907,6 +911,46 @@ static bool is_mem_sleep_state_supported(int power_dir, enum igt_mem_sleep state
 	return str;
 }
 
+static void igt_aux_pm_suspend_dbg_restore_exit_handler(int sig)
+{
+	int sysfs_fd;
+
+	sysfs_fd = open(SYSFS_MODULE_PRINTK, O_RDONLY);
+
+	if (sysfs_fd < 0)
+		return;
+
+	igt_sysfs_set_boolean(sysfs_fd, "console_suspend", __console_suspend_saved_state);
+	close(sysfs_fd);
+}
+
+/**
+ * igt_aux_enable_pm_suspend_dbg:
+ *
+ * Enhance the System wide suspend/resume debugging by,
+ * disabling console suspend. Disabling console suspend dump the suspend/resume
+ * logs over serial console. That will be useful to debug CI Suspend/Resume issues
+ * tagged with 'Incomplete' result.
+ */
+static void igt_aux_enable_pm_suspend_dbg(void)
+{
+	int sysfs_fd;
+
+	sysfs_fd = open(SYSFS_MODULE_PRINTK, O_RDONLY);
+	if (sysfs_fd > 0) {
+		__console_suspend_saved_state = igt_sysfs_get_boolean(sysfs_fd, "console_suspend");
+
+		if (!igt_sysfs_set_boolean(sysfs_fd, "console_suspend", CONSOLE_SUSPEND_DISABLE))
+			igt_warn("Unable to disable console suspend\n");
+
+		igt_install_exit_handler(igt_aux_pm_suspend_dbg_restore_exit_handler);
+	} else {
+		igt_warn("Unable to open printk parameters Err:%d\n", errno);
+	}
+
+	close(sysfs_fd);
+}
+
 /**
  * igt_system_suspend_autoresume:
  * @state: an #igt_suspend_state, the target suspend state
@@ -945,6 +989,7 @@ void igt_system_suspend_autoresume(enum igt_suspend_state state,
 		      "Suspend to disk requires swap space.\n");
 
 	orig_test = get_suspend_test(power_dir);
+	igt_aux_enable_pm_suspend_dbg();
 
 	if (state == SUSPEND_STATE_S3) {
 		orig_mem_sleep = get_mem_sleep();
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [igt-dev] [PATCH i-g-t v4 2/2] lib/igt_aux: Enable PM Suspend dbg messages
  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 ` Anshuman Gupta
  2023-06-26 22:52   ` Dixit, Ashutosh
  2023-06-26 14:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for PM Suspend debug (rev5) Patchwork
  2 siblings, 1 reply; 5+ messages in thread
From: Anshuman Gupta @ 2023-06-26 12:50 UTC (permalink / raw)
  To: igt-dev; +Cc: badal.nilawar

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);
+	power_dir = open("/sys/power", O_RDONLY);
+
+	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,
- * disabling console suspend. Disabling console suspend dump the suspend/resume
- * logs over serial console. That will be useful to debug CI Suspend/Resume issues
- * tagged with 'Incomplete' result.
+ * disabling console suspend and enabling PM debug messages.
+ * Disabling console suspend dump the suspend/resume logs over serial console.
+ * That will be useful to debug CI Suspend/Resume issues tagged
+ * with 'Incomplete' result.
+ * pm_debug_messages sysfs enables Linux PM Core debug messages, which will
+ * be useful to debug system wide suspend/resume related issues.
  */
-static void igt_aux_enable_pm_suspend_dbg(void)
+static void igt_aux_enable_pm_suspend_dbg(int power_dir)
 {
 	int sysfs_fd;
 
@@ -943,11 +957,18 @@ static void igt_aux_enable_pm_suspend_dbg(void)
 		if (!igt_sysfs_set_boolean(sysfs_fd, "console_suspend", CONSOLE_SUSPEND_DISABLE))
 			igt_warn("Unable to disable console suspend\n");
 
-		igt_install_exit_handler(igt_aux_pm_suspend_dbg_restore_exit_handler);
 	} else {
 		igt_warn("Unable to open printk parameters Err:%d\n", errno);
 	}
 
+	/* pm_debug_messages depends on  CONFIG_PM_SLEEP_DEBUG */
+	if (!faccessat(power_dir, "pm_debug_messages", R_OK |  W_OK, 0)) {
+		__pm_debug_messages_state = igt_sysfs_get_boolean(sysfs_fd, "pm_debug_messages");
+		igt_sysfs_set_boolean(power_dir, "pm_debug_messages", true);
+	}
+
+	igt_install_exit_handler(igt_aux_pm_suspend_dbg_restore_exit_handler);
+
 	close(sysfs_fd);
 }
 
@@ -989,7 +1010,7 @@ void igt_system_suspend_autoresume(enum igt_suspend_state state,
 		      "Suspend to disk requires swap space.\n");
 
 	orig_test = get_suspend_test(power_dir);
-	igt_aux_enable_pm_suspend_dbg();
+	igt_aux_enable_pm_suspend_dbg(power_dir);
 
 	if (state == SUSPEND_STATE_S3) {
 		orig_mem_sleep = get_mem_sleep();
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for PM Suspend debug (rev5)
  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 14:04 ` Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2023-06-26 14:04 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 7723 bytes --]

== Series Details ==

Series: PM Suspend debug (rev5)
URL   : https://patchwork.freedesktop.org/series/119371/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13322 -> IGTPW_9255
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_9255 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_9255, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/index.html

Participating hosts (42 -> 41)
------------------------------

  Missing    (1): fi-snb-2520m 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_9255:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-vga-1:
    - fi-hsw-4770:        [PASS][1] -> [ABORT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/fi-hsw-4770/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-vga-1.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/fi-hsw-4770/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-vga-1.html

  
Known issues
------------

  Here are the changes found in IGTPW_9255 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_parallel@engines@userptr:
    - bat-mtlp-6:         [PASS][3] -> [FAIL][4] ([i915#8672])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-mtlp-6/igt@gem_exec_parallel@engines@userptr.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-mtlp-6/igt@gem_exec_parallel@engines@userptr.html

  * igt@i915_module_load@load:
    - bat-adlp-11:        [PASS][5] -> [ABORT][6] ([i915#4423])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-adlp-11/igt@i915_module_load@load.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-adlp-11/igt@i915_module_load@load.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-glk-j4005:       [PASS][7] -> [DMESG-FAIL][8] ([i915#5334])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@gt_mocs:
    - bat-mtlp-6:         [PASS][9] -> [DMESG-FAIL][10] ([i915#7059])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@requests:
    - bat-rpls-2:         [PASS][11] -> [ABORT][12] ([i915#4983] / [i915#7913])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-rpls-2/igt@i915_selftest@live@requests.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-rpls-2/igt@i915_selftest@live@requests.html

  * igt@i915_selftest@live@slpc:
    - bat-mtlp-6:         [PASS][13] -> [DMESG-WARN][14] ([i915#6367])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-mtlp-6/igt@i915_selftest@live@slpc.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-mtlp-6/igt@i915_selftest@live@slpc.html
    - bat-rpls-1:         NOTRUN -> [DMESG-WARN][15] ([i915#6367])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-rpls-1/igt@i915_selftest@live@slpc.html

  * igt@i915_suspend@basic-s3-without-i915:
    - bat-rpls-1:         NOTRUN -> [ABORT][16] ([i915#6687] / [i915#7978])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-rpls-1/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
    - bat-dg2-11:         NOTRUN -> [SKIP][17] ([i915#7828])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-dg2-11/igt@kms_chamelium_hpd@common-hpd-after-suspend.html

  
#### Possible fixes ####

  * igt@gem_basic@create-close:
    - fi-kbl-soraka:      [INCOMPLETE][18] -> [PASS][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/fi-kbl-soraka/igt@gem_basic@create-close.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/fi-kbl-soraka/igt@gem_basic@create-close.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-kbl-soraka:      [DMESG-FAIL][20] ([i915#5334] / [i915#7872]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@gt_mocs:
    - bat-mtlp-8:         [DMESG-FAIL][22] ([i915#7059]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@hangcheck:
    - bat-dg2-11:         [INCOMPLETE][24] ([i915#7913]) -> [PASS][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-dg2-11/igt@i915_selftest@live@hangcheck.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-dg2-11/igt@i915_selftest@live@hangcheck.html

  * igt@i915_selftest@live@requests:
    - bat-rpls-1:         [ABORT][26] ([i915#7911] / [i915#7920] / [i915#7982]) -> [PASS][27]
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-rpls-1/igt@i915_selftest@live@requests.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-rpls-1/igt@i915_selftest@live@requests.html

  
#### Warnings ####

  * igt@kms_psr@primary_page_flip:
    - bat-rplp-1:         [SKIP][28] ([i915#1072]) -> [ABORT][29] ([i915#8442])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13322/bat-rplp-1/igt@kms_psr@primary_page_flip.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/bat-rplp-1/igt@kms_psr@primary_page_flip.html

  
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
  [i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920
  [i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
  [i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982
  [i915#8442]: https://gitlab.freedesktop.org/drm/intel/issues/8442
  [i915#8672]: https://gitlab.freedesktop.org/drm/intel/issues/8672


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7349 -> IGTPW_9255

  CI-20190529: 20190529
  CI_DRM_13322: 7067d1a82560a2e79adefac0d28e08cb163ae907 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_9255: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/index.html
  IGT_7349: eba3d515fbb832edc7fabcbf90e2564aa7face7b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9255/index.html

[-- Attachment #2: Type: text/html, Size: 8976 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v4 2/2] lib/igt_aux: Enable PM Suspend dbg messages
  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
  0 siblings, 0 replies; 5+ messages in thread
From: Dixit, Ashutosh @ 2023-06-26 22:52 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev, badal.nilawar

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-26 22:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-06-26 14:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for PM Suspend debug (rev5) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.