[PATCH i-g-t v1] tests/intel/xe_gt_freq: Change basic throttle API test criteria

Raag Jadav raag.jadav at intel.com
Tue Nov 5 06:32:28 UTC 2024


Basic throttle API test is implemented in a way that expects multiple
sysfs reads to provide atomic results. Since atomicity is never guaranteed
between multiple sysfs reads, this is an incorrect expection from the test.
Change the test criteria to check for boolean value from throttle status
and throttle reasons sysfs entries.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3254
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3147
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2810
Signed-off-by: Raag Jadav <raag.jadav at intel.com>
---
 tests/intel/xe_gt_freq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
index de4d111ea..632415d33 100644
--- a/tests/intel/xe_gt_freq.c
+++ b/tests/intel/xe_gt_freq.c
@@ -121,10 +121,8 @@ static void test_throttle_basic_api(int fd, int gt_id)
 	reasons |= get_throttle(fd, gt_id, "reason_vr_tdc");
 	reasons |= get_throttle(fd, gt_id, "reason_vr_thermalert");
 
-	if (status)
-		igt_assert(reasons);
-	else
-		igt_assert(!reasons);
+	igt_assert(status == true || status == false);
+	igt_assert(reasons == true || reasons == false);
 }
 
 /**
-- 
2.34.1



More information about the igt-dev mailing list