public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 3/4] drm/i915: return -ENOENT if the context doesn't exist
Date: Tue, 19 Jun 2012 18:27:49 +0200	[thread overview]
Message-ID: <20120619162749.GA5031@phenom.ffwll.local> (raw)
In-Reply-To: <20120619091911.3c4a7bde@bwidawsk.net>

On Tue, Jun 19, 2012 at 09:19:11AM -0700, Ben Widawsky wrote:
> On Tue, 19 Jun 2012 16:52:31 +0200
> Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> 
> > This is our customary "no such object" errno, not -EINVAL.
> > 
> > Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> You've missed idr_cleanup for this. That doesn't get back down to
> userspace, but it keeps things consistent.

Yeah, I've noticed the -ENXIO in the cleanup code. I think we can
completely rip that one out (and it won't ever reach userspace anyway), so
I've decided to ingore that one. I'll stitch toghet that patch quickly.
-Daniel

> 
> With that, this is
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_context.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> > index 671927a..3d8ae6c 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_context.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> > @@ -455,7 +455,7 @@ int i915_switch_context(struct intel_ring_buffer *ring,
> >  	} else {
> >  		to = i915_gem_context_get(file_priv, to_id);
> >  		if (to == NULL)
> > -			return -EINVAL;
> > +			return -ENOENT;
> >  	}
> >  
> >  	if (from_obj == to->obj)
> > @@ -521,7 +521,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
> >  	ctx = i915_gem_context_get(file_priv, args->ctx_id);
> >  	if (!ctx) {
> >  		mutex_unlock(&dev->struct_mutex);
> > -		return -EINVAL;
> > +		return -ENOENT;
> >  	}
> >  
> >  	do_destroy(ctx);
> 
> 
> 
> -- 
> Ben Widawsky, Intel Open Source Technology Center

-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2012-06-19 16:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 14:52 [PATCH 1/4] drm/i915: fix module unload after context merge Daniel Vetter
2012-06-19 14:52 ` [PATCH 2/4] drm/i915: initialize the context idr unconditionally Daniel Vetter
2012-06-19 17:43   ` Ben Widawsky
2012-06-19 14:52 ` [PATCH 3/4] drm/i915: return -ENOENT if the context doesn't exist Daniel Vetter
2012-06-19 16:19   ` Ben Widawsky
2012-06-19 16:27     ` Daniel Vetter [this message]
2012-06-19 14:52 ` [PATCH 4/4] drm/i915/context: shut up compiler Daniel Vetter
2012-06-19 16:16   ` Ben Widawsky
2012-06-19 17:32 ` [PATCH 1/4] drm/i915: fix module unload after context merge Ben Widawsky
2012-06-19 19:55   ` [PATCH] " Daniel Vetter
2012-06-19 21:19     ` Ben Widawsky

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=20120619162749.GA5031@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ben@bwidawsk.net \
    --cc=daniel.vetter@ffwll.ch \
    --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