All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Add a safety net to live_workarounds
@ 2018-07-11  9:59 Chris Wilson
  2018-07-11 10:39 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Chris Wilson @ 2018-07-11  9:59 UTC (permalink / raw)
  To: intel-gfx

Since live_workarounds poke around the w/a registers and checks to see
if they survive across a reset, we are prone to fouling the machine and
leaving it in a non-recoverable state. Wrap the probe inside a timeout
to abort the test if the reset fails.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/selftests/igt_wedge_me.h | 48 +++++++++++++++++++
 .../drm/i915/selftests/intel_workarounds.c    |  8 +++-
 2 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/i915/selftests/igt_wedge_me.h

diff --git a/drivers/gpu/drm/i915/selftests/igt_wedge_me.h b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
new file mode 100644
index 000000000000..d2518cf9a5c8
--- /dev/null
+++ b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
@@ -0,0 +1,48 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright © 2018 Intel Corporation
+ */
+
+#ifndef IGT_WEDGE_ME_H
+#define IGT_WEDGE_ME_H
+
+struct igt_wedge_me {
+	struct delayed_work work;
+	struct drm_i915_private *i915;
+	const char *name;
+};
+
+static void __igt_wedge_me(struct work_struct *work)
+{
+	struct igt_wedge_me *w = container_of(work, typeof(*w), work.work);
+
+	pr_err("%s timed out, cancelling test.\n", w->name);
+	i915_gem_set_wedged(w->i915);
+}
+
+static void __igt_init_wedge(struct igt_wedge_me *w,
+			     struct drm_i915_private *i915,
+			     long timeout,
+			     const char *name)
+{
+	w->i915 = i915;
+	w->name = name;
+
+	INIT_DELAYED_WORK_ONSTACK(&w->work, __igt_wedge_me);
+	schedule_delayed_work(&w->work, timeout);
+}
+
+static void __igt_fini_wedge(struct igt_wedge_me *w)
+{
+	cancel_delayed_work_sync(&w->work);
+	destroy_delayed_work_on_stack(&w->work);
+	w->i915 = NULL;
+}
+
+#define igt_wedge_on_timeout(W, DEV, TIMEOUT)				\
+	for (__igt_init_wedge((W), (DEV), (TIMEOUT), __func__);		\
+	     (W)->i915;							\
+	     __igt_fini_wedge((W)))
+
+#endif /* IGT_WEDGE_ME_H */
diff --git a/drivers/gpu/drm/i915/selftests/intel_workarounds.c b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
index fafdec3fe83e..0d39b3bf0c0d 100644
--- a/drivers/gpu/drm/i915/selftests/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
@@ -6,6 +6,7 @@
 
 #include "../i915_selftest.h"
 
+#include "igt_wedge_me.h"
 #include "mock_context.h"
 
 static struct drm_i915_gem_object *
@@ -111,6 +112,7 @@ static int check_whitelist(const struct whitelist *w,
 			   struct intel_engine_cs *engine)
 {
 	struct drm_i915_gem_object *results;
+	struct igt_wedge_me wedge;
 	u32 *vaddr;
 	int err;
 	int i;
@@ -119,7 +121,11 @@ static int check_whitelist(const struct whitelist *w,
 	if (IS_ERR(results))
 		return PTR_ERR(results);
 
-	err = i915_gem_object_set_to_cpu_domain(results, false);
+	err = 0;
+	igt_wedge_on_timeout(&wedge, ctx->i915, HZ / 5) /* a safety net! */
+		err = i915_gem_object_set_to_cpu_domain(results, false);
+	if (i915_terminally_wedged(&ctx->i915->gpu_error))
+		err = -EIO;
 	if (err)
 		goto out_put;
 
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
@ 2018-07-11 10:39 ` Patchwork
  2018-07-11 10:58 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-07-11 10:39 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Add a safety net to live_workarounds
URL   : https://patchwork.freedesktop.org/series/46301/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
5f67aab2a681 drm/i915/selftests: Add a safety net to live_workarounds
-:15: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#15: 
new file mode 100644

-:20: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1
#20: FILE: drivers/gpu/drm/i915/selftests/igt_wedge_me.h:1:
+/*

-:62: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'W' - possible side-effects?
#62: FILE: drivers/gpu/drm/i915/selftests/igt_wedge_me.h:43:
+#define igt_wedge_on_timeout(W, DEV, TIMEOUT)				\
+	for (__igt_init_wedge((W), (DEV), (TIMEOUT), __func__);		\
+	     (W)->i915;							\
+	     __igt_fini_wedge((W)))

total: 0 errors, 2 warnings, 1 checks, 74 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
  2018-07-11 10:39 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-07-11 10:58 ` Patchwork
  2018-07-11 11:27 ` [PATCH] " Mika Kuoppala
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-07-11 10:58 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Add a safety net to live_workarounds
URL   : https://patchwork.freedesktop.org/series/46301/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4469 -> Patchwork_9608 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/46301/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_9608 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713


== Participating hosts (46 -> 42) ==

  Missing    (4): fi-ctg-p8600 fi-ilk-m540 fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4469 -> Patchwork_9608

  CI_DRM_4469: 02e578b7aace48d33fa617dddb40621bd664c92c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4546: e8905e756cf3640c66541e963ff97f8af2d98936 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9608: 5f67aab2a68116f2e263f154cce9ea87a8084ce5 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

5f67aab2a681 drm/i915/selftests: Add a safety net to live_workarounds

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9608/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
  2018-07-11 10:39 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-07-11 10:58 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-07-11 11:27 ` Mika Kuoppala
  2018-07-11 11:39   ` Chris Wilson
  2018-07-11 12:27 ` [PATCH v2] " Chris Wilson
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Mika Kuoppala @ 2018-07-11 11:27 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Since live_workarounds poke around the w/a registers and checks to see
> if they survive across a reset, we are prone to fouling the machine and
> leaving it in a non-recoverable state. Wrap the probe inside a timeout
> to abort the test if the reset fails.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188

How can we tell it is not about just reset flakyness but
associated whitelist poking?

-Mika

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/selftests/igt_wedge_me.h | 48 +++++++++++++++++++
>  .../drm/i915/selftests/intel_workarounds.c    |  8 +++-
>  2 files changed, 55 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/selftests/igt_wedge_me.h
>
> diff --git a/drivers/gpu/drm/i915/selftests/igt_wedge_me.h b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
> new file mode 100644
> index 000000000000..d2518cf9a5c8
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
> @@ -0,0 +1,48 @@
> +/*
> + * SPDX-License-Identifier: MIT
> + *
> + * Copyright © 2018 Intel Corporation
> + */
> +
> +#ifndef IGT_WEDGE_ME_H
> +#define IGT_WEDGE_ME_H
> +
> +struct igt_wedge_me {
> +	struct delayed_work work;
> +	struct drm_i915_private *i915;
> +	const char *name;
> +};
> +
> +static void __igt_wedge_me(struct work_struct *work)
> +{
> +	struct igt_wedge_me *w = container_of(work, typeof(*w), work.work);
> +
> +	pr_err("%s timed out, cancelling test.\n", w->name);
> +	i915_gem_set_wedged(w->i915);
> +}
> +
> +static void __igt_init_wedge(struct igt_wedge_me *w,
> +			     struct drm_i915_private *i915,
> +			     long timeout,
> +			     const char *name)
> +{
> +	w->i915 = i915;
> +	w->name = name;
> +
> +	INIT_DELAYED_WORK_ONSTACK(&w->work, __igt_wedge_me);
> +	schedule_delayed_work(&w->work, timeout);
> +}
> +
> +static void __igt_fini_wedge(struct igt_wedge_me *w)
> +{
> +	cancel_delayed_work_sync(&w->work);
> +	destroy_delayed_work_on_stack(&w->work);
> +	w->i915 = NULL;
> +}
> +
> +#define igt_wedge_on_timeout(W, DEV, TIMEOUT)				\
> +	for (__igt_init_wedge((W), (DEV), (TIMEOUT), __func__);		\
> +	     (W)->i915;							\
> +	     __igt_fini_wedge((W)))
> +
> +#endif /* IGT_WEDGE_ME_H */
> diff --git a/drivers/gpu/drm/i915/selftests/intel_workarounds.c b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
> index fafdec3fe83e..0d39b3bf0c0d 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
> @@ -6,6 +6,7 @@
>  
>  #include "../i915_selftest.h"
>  
> +#include "igt_wedge_me.h"
>  #include "mock_context.h"
>  
>  static struct drm_i915_gem_object *
> @@ -111,6 +112,7 @@ static int check_whitelist(const struct whitelist *w,
>  			   struct intel_engine_cs *engine)
>  {
>  	struct drm_i915_gem_object *results;
> +	struct igt_wedge_me wedge;
>  	u32 *vaddr;
>  	int err;
>  	int i;
> @@ -119,7 +121,11 @@ static int check_whitelist(const struct whitelist *w,
>  	if (IS_ERR(results))
>  		return PTR_ERR(results);
>  
> -	err = i915_gem_object_set_to_cpu_domain(results, false);
> +	err = 0;
> +	igt_wedge_on_timeout(&wedge, ctx->i915, HZ / 5) /* a safety net! */
> +		err = i915_gem_object_set_to_cpu_domain(results, false);
> +	if (i915_terminally_wedged(&ctx->i915->gpu_error))
> +		err = -EIO;
>  	if (err)
>  		goto out_put;
>  
> -- 
> 2.18.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11 11:27 ` [PATCH] " Mika Kuoppala
@ 2018-07-11 11:39   ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-07-11 11:39 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx

Quoting Mika Kuoppala (2018-07-11 12:27:49)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Since live_workarounds poke around the w/a registers and checks to see
> > if they survive across a reset, we are prone to fouling the machine and
> > leaving it in a non-recoverable state. Wrap the probe inside a timeout
> > to abort the test if the reset fails.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
> 
> How can we tell it is not about just reset flakyness but
> associated whitelist poking?

By reading the dmesg. All we are doing here is breaking the indefinite
wait (as we've disabled hangcheck so as to not interfere with out own
resets) before owatch declares INCOMPLETE.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
                   ` (2 preceding siblings ...)
  2018-07-11 11:27 ` [PATCH] " Mika Kuoppala
@ 2018-07-11 12:27 ` Chris Wilson
  2018-07-11 12:29 ` [PATCH v3] " Chris Wilson
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-07-11 12:27 UTC (permalink / raw)
  To: intel-gfx

Since live_workarounds poke around the w/a registers and checks to see
if they survive across a reset, we are prone to fouling the machine and
leaving it in a non-recoverable state. Wrap the probe inside a timeout
to abort the test if the reset fails.

v2: Include GEM_TRACE on declaring wedged.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/selftests/igt_wedge_me.h | 52 +++++++++++++++++++
 .../drm/i915/selftests/intel_workarounds.c    |  8 ++-
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/i915/selftests/igt_wedge_me.h

diff --git a/drivers/gpu/drm/i915/selftests/igt_wedge_me.h b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
new file mode 100644
index 000000000000..0c5193516021
--- /dev/null
+++ b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
@@ -0,0 +1,52 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright © 2018 Intel Corporation
+ */
+
+#ifndef IGT_WEDGE_ME_H
+#define IGT_WEDGE_ME_H
+
+struct igt_wedge_me {
+	struct delayed_work work;
+	struct drm_i915_private *i915;
+	const char *name;
+};
+
+static void __igt_wedge_me(struct work_struct *work)
+{
+	struct igt_wedge_me *w = container_of(work, typeof(*w), work.work);
+
+	pr_err("%s timed out, cancelling test.\n", w->name);
+
+	GEM_TRACE("%s timed out.\n", w->name);
+	GEM_TRACE_DUMP();
+
+	i915_gem_set_wedged(w->i915);
+}
+
+static void __igt_init_wedge(struct igt_wedge_me *w,
+			     struct drm_i915_private *i915,
+			     long timeout,
+			     const char *name)
+{
+	w->i915 = i915;
+	w->name = name;
+
+	INIT_DELAYED_WORK_ONSTACK(&w->work, __igt_wedge_me);
+	schedule_delayed_work(&w->work, timeout);
+}
+
+static void __igt_fini_wedge(struct igt_wedge_me *w)
+{
+	cancel_delayed_work_sync(&w->work);
+	destroy_delayed_work_on_stack(&w->work);
+	w->i915 = NULL;
+}
+
+#define igt_wedge_on_timeout(W, DEV, TIMEOUT)				\
+	for (__igt_init_wedge((W), (DEV), (TIMEOUT), __func__);		\
+	     (W)->i915;							\
+	     __igt_fini_wedge((W)))
+
+#endif /* IGT_WEDGE_ME_H */
diff --git a/drivers/gpu/drm/i915/selftests/intel_workarounds.c b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
index fafdec3fe83e..0d39b3bf0c0d 100644
--- a/drivers/gpu/drm/i915/selftests/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
@@ -6,6 +6,7 @@
 
 #include "../i915_selftest.h"
 
+#include "igt_wedge_me.h"
 #include "mock_context.h"
 
 static struct drm_i915_gem_object *
@@ -111,6 +112,7 @@ static int check_whitelist(const struct whitelist *w,
 			   struct intel_engine_cs *engine)
 {
 	struct drm_i915_gem_object *results;
+	struct igt_wedge_me wedge;
 	u32 *vaddr;
 	int err;
 	int i;
@@ -119,7 +121,11 @@ static int check_whitelist(const struct whitelist *w,
 	if (IS_ERR(results))
 		return PTR_ERR(results);
 
-	err = i915_gem_object_set_to_cpu_domain(results, false);
+	err = 0;
+	igt_wedge_on_timeout(&wedge, ctx->i915, HZ / 5) /* a safety net! */
+		err = i915_gem_object_set_to_cpu_domain(results, false);
+	if (i915_terminally_wedged(&ctx->i915->gpu_error))
+		err = -EIO;
 	if (err)
 		goto out_put;
 
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v3] drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
                   ` (3 preceding siblings ...)
  2018-07-11 12:27 ` [PATCH v2] " Chris Wilson
@ 2018-07-11 12:29 ` Chris Wilson
  2018-07-11 13:05   ` Mika Kuoppala
  2018-07-11 13:19 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: Add a safety net to live_workarounds (rev3) Patchwork
  2018-07-11 13:35 ` ✓ Fi.CI.BAT: success " Patchwork
  6 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2018-07-11 12:29 UTC (permalink / raw)
  To: intel-gfx

Since live_workarounds poke around the w/a registers and checks to see
if they survive across a reset, we are prone to fouling the machine and
leaving it in a non-recoverable state. Wrap the probe inside a timeout
to abort the test if the reset fails.

v2: Include GEM_TRACE on declaring wedged.
v3: Add a few includes to make the header look standalone.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/selftests/igt_wedge_me.h | 58 +++++++++++++++++++
 .../drm/i915/selftests/intel_workarounds.c    |  8 ++-
 2 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/i915/selftests/igt_wedge_me.h

diff --git a/drivers/gpu/drm/i915/selftests/igt_wedge_me.h b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
new file mode 100644
index 000000000000..08e5ff11bbd9
--- /dev/null
+++ b/drivers/gpu/drm/i915/selftests/igt_wedge_me.h
@@ -0,0 +1,58 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright © 2018 Intel Corporation
+ */
+
+#ifndef IGT_WEDGE_ME_H
+#define IGT_WEDGE_ME_H
+
+#include <linux/workqueue.h>
+
+#include "../i915_gem.h"
+
+struct drm_i915_private;
+
+struct igt_wedge_me {
+	struct delayed_work work;
+	struct drm_i915_private *i915;
+	const char *name;
+};
+
+static void __igt_wedge_me(struct work_struct *work)
+{
+	struct igt_wedge_me *w = container_of(work, typeof(*w), work.work);
+
+	pr_err("%s timed out, cancelling test.\n", w->name);
+
+	GEM_TRACE("%s timed out.\n", w->name);
+	GEM_TRACE_DUMP();
+
+	i915_gem_set_wedged(w->i915);
+}
+
+static void __igt_init_wedge(struct igt_wedge_me *w,
+			     struct drm_i915_private *i915,
+			     long timeout,
+			     const char *name)
+{
+	w->i915 = i915;
+	w->name = name;
+
+	INIT_DELAYED_WORK_ONSTACK(&w->work, __igt_wedge_me);
+	schedule_delayed_work(&w->work, timeout);
+}
+
+static void __igt_fini_wedge(struct igt_wedge_me *w)
+{
+	cancel_delayed_work_sync(&w->work);
+	destroy_delayed_work_on_stack(&w->work);
+	w->i915 = NULL;
+}
+
+#define igt_wedge_on_timeout(W, DEV, TIMEOUT)				\
+	for (__igt_init_wedge((W), (DEV), (TIMEOUT), __func__);		\
+	     (W)->i915;							\
+	     __igt_fini_wedge((W)))
+
+#endif /* IGT_WEDGE_ME_H */
diff --git a/drivers/gpu/drm/i915/selftests/intel_workarounds.c b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
index fafdec3fe83e..0d39b3bf0c0d 100644
--- a/drivers/gpu/drm/i915/selftests/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
@@ -6,6 +6,7 @@
 
 #include "../i915_selftest.h"
 
+#include "igt_wedge_me.h"
 #include "mock_context.h"
 
 static struct drm_i915_gem_object *
@@ -111,6 +112,7 @@ static int check_whitelist(const struct whitelist *w,
 			   struct intel_engine_cs *engine)
 {
 	struct drm_i915_gem_object *results;
+	struct igt_wedge_me wedge;
 	u32 *vaddr;
 	int err;
 	int i;
@@ -119,7 +121,11 @@ static int check_whitelist(const struct whitelist *w,
 	if (IS_ERR(results))
 		return PTR_ERR(results);
 
-	err = i915_gem_object_set_to_cpu_domain(results, false);
+	err = 0;
+	igt_wedge_on_timeout(&wedge, ctx->i915, HZ / 5) /* a safety net! */
+		err = i915_gem_object_set_to_cpu_domain(results, false);
+	if (i915_terminally_wedged(&ctx->i915->gpu_error))
+		err = -EIO;
 	if (err)
 		goto out_put;
 
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v3] drm/i915/selftests: Add a safety net to live_workarounds
  2018-07-11 12:29 ` [PATCH v3] " Chris Wilson
@ 2018-07-11 13:05   ` Mika Kuoppala
  0 siblings, 0 replies; 10+ messages in thread
From: Mika Kuoppala @ 2018-07-11 13:05 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Since live_workarounds poke around the w/a registers and checks to see
> if they survive across a reset, we are prone to fouling the machine and
> leaving it in a non-recoverable state. Wrap the probe inside a timeout
> to abort the test if the reset fails.
>
> v2: Include GEM_TRACE on declaring wedged.
> v3: Add a few includes to make the header look standalone.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107188
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: Add a safety net to live_workarounds (rev3)
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
                   ` (4 preceding siblings ...)
  2018-07-11 12:29 ` [PATCH v3] " Chris Wilson
@ 2018-07-11 13:19 ` Patchwork
  2018-07-11 13:35 ` ✓ Fi.CI.BAT: success " Patchwork
  6 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-07-11 13:19 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Add a safety net to live_workarounds (rev3)
URL   : https://patchwork.freedesktop.org/series/46301/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
a79baf771e2d drm/i915/selftests: Add a safety net to live_workarounds
-:20: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#20: 
new file mode 100644

-:25: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1
#25: FILE: drivers/gpu/drm/i915/selftests/igt_wedge_me.h:1:
+/*

-:77: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'W' - possible side-effects?
#77: FILE: drivers/gpu/drm/i915/selftests/igt_wedge_me.h:53:
+#define igt_wedge_on_timeout(W, DEV, TIMEOUT)				\
+	for (__igt_init_wedge((W), (DEV), (TIMEOUT), __func__);		\
+	     (W)->i915;							\
+	     __igt_fini_wedge((W)))

total: 0 errors, 2 warnings, 1 checks, 84 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Add a safety net to live_workarounds (rev3)
  2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
                   ` (5 preceding siblings ...)
  2018-07-11 13:19 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: Add a safety net to live_workarounds (rev3) Patchwork
@ 2018-07-11 13:35 ` Patchwork
  6 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-07-11 13:35 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Add a safety net to live_workarounds (rev3)
URL   : https://patchwork.freedesktop.org/series/46301/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4469 -> Patchwork_9611 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/46301/revisions/3/mbox/

== Known issues ==

  Here are the changes found in Patchwork_9611 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         PASS -> FAIL (fdo#104008)

    
  fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008


== Participating hosts (46 -> 42) ==

  Missing    (4): fi-ctg-p8600 fi-ilk-m540 fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4469 -> Patchwork_9611

  CI_DRM_4469: 02e578b7aace48d33fa617dddb40621bd664c92c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4546: e8905e756cf3640c66541e963ff97f8af2d98936 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9611: a79baf771e2ded4da419df9ae6a4925d4e80ef02 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

a79baf771e2d drm/i915/selftests: Add a safety net to live_workarounds

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9611/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-07-11 13:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11  9:59 [PATCH] drm/i915/selftests: Add a safety net to live_workarounds Chris Wilson
2018-07-11 10:39 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-07-11 10:58 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-11 11:27 ` [PATCH] " Mika Kuoppala
2018-07-11 11:39   ` Chris Wilson
2018-07-11 12:27 ` [PATCH v2] " Chris Wilson
2018-07-11 12:29 ` [PATCH v3] " Chris Wilson
2018-07-11 13:05   ` Mika Kuoppala
2018-07-11 13:19 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: Add a safety net to live_workarounds (rev3) Patchwork
2018-07-11 13:35 ` ✓ Fi.CI.BAT: success " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.