diff mbox series

drm/i915: Do not allow unwedging following a failed driver initialisation

Message ID 20190103213340.1669-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915: Do not allow unwedging following a failed driver initialisation | expand

Commit Message

Chris Wilson Jan. 3, 2019, 9:33 p.m. UTC
If we declare the driver wedged during early initialisation, we leave
the driver in an undefined state (with respect to GEM execution). As
this leads to unexpected behaviour if we allow the user to unwedge the
device (through debugfs, and performed by igt at test start), do not.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Mika Kuoppala Jan. 4, 2019, 9:02 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> If we declare the driver wedged during early initialisation, we leave
> the driver in an undefined state (with respect to GEM execution). As
> this leads to unexpected behaviour if we allow the user to unwedge the
> device (through debugfs, and performed by igt at test start), do not.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 943569487687..a08d70752cb2 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3380,6 +3380,9 @@ bool i915_gem_unset_wedged(struct drm_i915_private *i915)
>  	if (!test_bit(I915_WEDGED, &i915->gpu_error.flags))
>  		return true;
>  
> +	if (!i915->gt.scratch) /* Never full initialised, recovery impossible */
> +		return false;
> +
>  	GEM_TRACE("start\n");
>  
>  	/*
> -- 
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 943569487687..a08d70752cb2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3380,6 +3380,9 @@  bool i915_gem_unset_wedged(struct drm_i915_private *i915)
 	if (!test_bit(I915_WEDGED, &i915->gpu_error.flags))
 		return true;
 
+	if (!i915->gt.scratch) /* Never full initialised, recovery impossible */
+		return false;
+
 	GEM_TRACE("start\n");
 
 	/*