Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: lucas.demarchi@intel.com, John.C.Harrison@Intel.com,
	sujaritha.sundaresan@intel.com, rodrigo.vivi@intel.com,
	matthew.d.roper@intel.com, andi.shyti@linux.intel.com
Cc: igt-dev@lists.freedesktop.org, anshuman.gupta@intel.com,
	badal.nilawar@intel.com, riana.tauro@intel.com,
	Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH i-g-t v1] tests/intel/xe_gt_freq: Change basic throttle API test criteria
Date: Tue,  5 Nov 2024 12:02:28 +0530	[thread overview]
Message-ID: <20241105063228.452559-1-raag.jadav@intel.com> (raw)

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@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


             reply	other threads:[~2024-11-05  6:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  6:32 Raag Jadav [this message]
2024-11-05  9:50 ` ✓ Fi.CI.BAT: success for tests/intel/xe_gt_freq: Change basic throttle API test criteria Patchwork
2024-11-05 10:48 ` ✓ CI.xeBAT: " Patchwork
2024-11-05 16:09 ` [PATCH i-g-t v1] " Rodrigo Vivi
2024-11-06  5:20   ` Riana Tauro
2024-11-06  7:22   ` Raag Jadav
2024-11-06  4:44 ` ✗ Fi.CI.IGT: failure for " Patchwork
2024-11-06 11:41 ` ✗ CI.xeFULL: " 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=20241105063228.452559-1-raag.jadav@intel.com \
    --to=raag.jadav@intel.com \
    --cc=John.C.Harrison@Intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sujaritha.sundaresan@intel.com \
    /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