public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Katarzyna Dec <katarzyna.dec@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib/igt_gt: Move assert with setting 'reset' parameter after IGT env check
Date: Wed, 23 Jan 2019 15:04:04 +0100	[thread overview]
Message-ID: <20190123140404.11299-1-katarzyna.dec@intel.com> (raw)

We are trying to set reset parameter earlier than checking IGT env.
Let's move it after checking IGT env to avoid setting reset parameter
when hang injection is disabled.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
---
 lib/igt_gt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index dd28d821..64669672 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -170,15 +170,15 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
 	 */
 	igt_require_gem(fd);
 
-	igt_assert(igt_sysfs_set_parameter
-		   (fd, "reset", "%d", INT_MAX /* any reset method */));
-
 	if (!igt_check_boolean_env_var("IGT_HANG", true))
 		igt_skip("hang injection disabled by user");
 	gem_context_require_bannable(fd);
 	if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
 		igt_require(has_gpu_reset(fd));
 
+	igt_assert(igt_sysfs_set_parameter
+		   (fd, "reset", "%d", INT_MAX /* any reset method */));
+
 	if ((flags & HANG_ALLOW_CAPTURE) == 0) {
 		param.param = I915_CONTEXT_PARAM_NO_ERROR_CAPTURE;
 		param.value = 1;
-- 
2.17.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-01-23 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 14:04 Katarzyna Dec [this message]
2019-01-23 14:12 ` [igt-dev] [PATCH i-g-t] lib/igt_gt: Move assert with setting 'reset' parameter after IGT env check Chris Wilson
2019-01-23 16:54   ` Daniel Vetter
2019-01-23 15:17 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-23 17:59 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20190123140404.11299-1-katarzyna.dec@intel.com \
    --to=katarzyna.dec@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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