public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Don't deref context->file_priv ERR_PTR upon reset
@ 2016-11-21 13:26 Chris Wilson
  2016-11-21 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2016-11-22 14:27 ` [PATCH] " Mika Kuoppala
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2016-11-21 13:26 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

When a user context is closed, it's file_priv backpointer is replaced by
ERR_PTR(-EBADF); be careful not to chase this invalid pointer after a
hang and a GPU reset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes: b083a0870c79 ("drm/i915: Add per client max context ban limit")
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b850e66c2f83..d75196b86693 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2647,16 +2647,12 @@ static void i915_gem_context_mark_guilty(struct i915_gem_context *ctx)
 			 ctx->name, ctx->ban_score,
 			 yesno(ctx->banned));
 
-	if (!ctx->file_priv)
+	if (!ctx->banned || IS_ERR_OR_NULL(ctx->file_priv))
 		return;
 
-	if (ctx->banned) {
-		ctx->file_priv->context_bans++;
-
-		DRM_DEBUG_DRIVER("client %s has has %d context banned\n",
-				 ctx->name,
-				 ctx->file_priv->context_bans);
-	}
+	ctx->file_priv->context_bans++;
+	DRM_DEBUG_DRIVER("client %s has had %d context banned\n",
+			 ctx->name, ctx->file_priv->context_bans);
 }
 
 static void i915_gem_context_mark_innocent(struct i915_gem_context *ctx)
-- 
2.10.2

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

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

* ✗ Fi.CI.BAT: failure for drm/i915: Don't deref context->file_priv ERR_PTR upon reset
  2016-11-21 13:26 [PATCH] drm/i915: Don't deref context->file_priv ERR_PTR upon reset Chris Wilson
@ 2016-11-21 17:23 ` Patchwork
  2016-11-22 14:27 ` [PATCH] " Mika Kuoppala
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-11-21 17:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Don't deref context->file_priv ERR_PTR upon reset
URL   : https://patchwork.freedesktop.org/series/15658/
State : failure

== Summary ==

Series 15658v1 drm/i915: Don't deref context->file_priv ERR_PTR upon reset
https://patchwork.freedesktop.org/api/1.0/series/15658/revisions/1/mbox/

Test drv_module_reload_basic:
                pass       -> DMESG-WARN (fi-skl-6770hq)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-skl-6260u)

fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:207  pass:194  dwarn:0   dfail:0   fail:0   skip:12 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:244  pass:229  dwarn:1   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

d6149d212b69a8e1d9229fe80fca034a0abe1d0e drm-intel-nightly: 2016y-11m-21d-12h-48m-13s UTC integration manifest
dab7666 drm/i915: Don't deref context->file_priv ERR_PTR upon reset

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3072/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Don't deref context->file_priv ERR_PTR upon reset
  2016-11-21 13:26 [PATCH] drm/i915: Don't deref context->file_priv ERR_PTR upon reset Chris Wilson
  2016-11-21 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2016-11-22 14:27 ` Mika Kuoppala
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Kuoppala @ 2016-11-22 14:27 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

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

> When a user context is closed, it's file_priv backpointer is replaced by
> ERR_PTR(-EBADF); be careful not to chase this invalid pointer after a
> hang and a GPU reset.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Fixes: b083a0870c79 ("drm/i915: Add per client max context ban limit")
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>

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

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index b850e66c2f83..d75196b86693 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2647,16 +2647,12 @@ static void i915_gem_context_mark_guilty(struct i915_gem_context *ctx)
>  			 ctx->name, ctx->ban_score,
>  			 yesno(ctx->banned));
>  
> -	if (!ctx->file_priv)
> +	if (!ctx->banned || IS_ERR_OR_NULL(ctx->file_priv))
>  		return;
>  
> -	if (ctx->banned) {
> -		ctx->file_priv->context_bans++;
> -
> -		DRM_DEBUG_DRIVER("client %s has has %d context banned\n",
> -				 ctx->name,
> -				 ctx->file_priv->context_bans);
> -	}
> +	ctx->file_priv->context_bans++;
> +	DRM_DEBUG_DRIVER("client %s has had %d context banned\n",
> +			 ctx->name, ctx->file_priv->context_bans);
>  }
>  
>  static void i915_gem_context_mark_innocent(struct i915_gem_context *ctx)
> -- 
> 2.10.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-11-22 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21 13:26 [PATCH] drm/i915: Don't deref context->file_priv ERR_PTR upon reset Chris Wilson
2016-11-21 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-11-22 14:27 ` [PATCH] " Mika Kuoppala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox