public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Don't deref context->file_priv ERR_PTR upon reset
Date: Tue, 22 Nov 2016 16:27:16 +0200	[thread overview]
Message-ID: <87eg23vbcr.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20161121132649.28531-1-chris@chris-wilson.co.uk>

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

      parent reply	other threads:[~2016-11-22 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=87eg23vbcr.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@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