Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] tests/intel/xe_pm_residency: Skip on igt_power_open failure
@ 2025-01-10 21:22 Jonathan Cavitt
  2025-01-10 22:20 ` ✓ Xe.CI.BAT: success for tests/intel/xe_pm_residency: Skip on igt_power_open failure (rev5) Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Jonathan Cavitt @ 2025-01-10 21:22 UTC (permalink / raw)
  To: igt-dev
  Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo, kamil.konieczny,
	riana.tauro

The xe_pm_residency@toggle-gt-c6 test fails when
gt_c6_power >= gt_c0_power.  These values are reported by
igt_power_get_mW, which will always report 0 in the case that
igt_power_open fails to open either the hwmon_fd or rapl.fd.  Since the
expected result will always be a failure in this case, skip the
assertion that gt_c6_power < gt_c0_power.

v2: Do not skip the full test, and instead only ignore the part that is
guaranteed to fail.

v3: Use || instead of && (Riana)

v4: Reprovision

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/958
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
---
 tests/intel/xe_pm_residency.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_pm_residency.c b/tests/intel/xe_pm_residency.c
index 06f4a0bc6b..f9e96d6087 100644
--- a/tests/intel/xe_pm_residency.c
+++ b/tests/intel/xe_pm_residency.c
@@ -289,10 +289,14 @@ static void measure_power(struct igt_power *gpu, double *power)
 static void toggle_gt_c6(int fd, int n)
 {
 	double gt_c0_power, gt_c6_power;
-	int gt;
+	int gt, ret;
 	struct igt_power gpu;
 
-	igt_power_open(fd, &gpu, "gpu");
+	/*
+	 * igt_power_get_mW will always return 0 if igt_power_open fails,
+	 * so skip the power check in this case.
+	 */
+	ret = igt_power_open(fd, &gpu, "gpu");
 
 	do {
 		fw_handle = igt_debugfs_open(fd, "forcewake_all", O_RDONLY);
@@ -319,7 +323,7 @@ static void toggle_gt_c6(int fd, int n)
 	igt_info("GPU consumed %fmW in GT C6 and %fmW in GT C0\n", gt_c6_power, gt_c0_power);
 
 	/* FIXME: Remove dgfx check after hwmon is added */
-	if (!xe_has_vram(fd))
+	if (!(xe_has_vram(fd) || ret))
 		igt_assert_f(gt_c6_power < gt_c0_power,
 			     "Power consumed in GT C6 should be lower than GT C0\n");
 }
-- 
2.43.0


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

end of thread, other threads:[~2025-01-16  9:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 21:22 [PATCH v4] tests/intel/xe_pm_residency: Skip on igt_power_open failure Jonathan Cavitt
2025-01-10 22:20 ` ✓ Xe.CI.BAT: success for tests/intel/xe_pm_residency: Skip on igt_power_open failure (rev5) Patchwork
2025-01-10 22:29 ` ✓ i915.CI.BAT: " Patchwork
2025-01-14 22:41 ` ✗ i915.CI.Full: failure " Patchwork
2025-01-16  4:32 ` ✗ Xe.CI.BAT: failure for tests/intel/xe_pm_residency: Skip on igt_power_open failure (rev6) Patchwork
2025-01-16  4:33 ` ✗ i915.CI.BAT: " Patchwork
2025-01-16  8:52 ` ✗ Xe.CI.Full: " Patchwork
2025-01-16  9:13   ` Kamil Konieczny
2025-01-16  9:41 ` [PATCH v4] tests/intel/xe_pm_residency: Skip on igt_power_open failure Kamil Konieczny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox