[PATCH i-g-t] tests/intel/xe_pm_residency: Skip on igt_power_open failure

Jonathan-Cavitt jonathan.cavitt at intel.com
Mon Sep 30 23:27:20 UTC 2024


The xe_pm_residency at 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 test to
end execution early.

Signed-off-by: Jonathan-Cavitt <jonathan.cavitt at intel.com>
---
 tests/intel/xe_pm_residency.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_pm_residency.c b/tests/intel/xe_pm_residency.c
index 0e687558b1..36ed46cfc5 100644
--- a/tests/intel/xe_pm_residency.c
+++ b/tests/intel/xe_pm_residency.c
@@ -276,7 +276,11 @@ static void toggle_gt_c6(int fd, int n)
 	int gt;
 	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 test in this case.
+	 */
+	igt_skip_on(igt_power_open(fd, &gpu, "gpu"));
 
 	do {
 		fw_handle = igt_debugfs_open(fd, "forcewake_all", O_RDONLY);
-- 
2.25.1



More information about the igt-dev mailing list