intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, "Zhang, Tina" <tina.zhang@intel.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	intel-gvt-dev <intel-gvt-dev@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Return -EPERM when i915_gem_mmap_ioctl handling prime objects
Date: Fri, 18 Aug 2017 11:40:00 +0300	[thread overview]
Message-ID: <1503045600.14144.3.camel@linux.intel.com> (raw)
In-Reply-To: <20170818080323.tw4vynyds6km5zrf@phenom.ffwll.local>

On Fri, 2017-08-18 at 10:03 +0200, Daniel Vetter wrote:
> On Wed, Aug 16, 2017 at 03:26:43AM +0000, Zhang, Tina wrote:

<SNIP>

> > > Quoting Daniel Vetter (2017-08-15 15:48:03)
> > > > On Tue, Aug 15, 2017 at 4:35 PM, Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> > > > - If we need that special errno, can we take something else? EPERM imo
> > > > has fairly specific meaning. ENODEV/ENOTTY are more the "not supported
> > > > on this thing" error codes, if we need a special one. They also have
> > > > other meanings attached already, but then everything excpe EINVAL has
> > > > when we do an ioctl, since the vfs can already throw these at you
> > > > anyway.
> > > 
> > > ENODEV at the ioctl level we already have to mean that the device doesn't
> > > support the operation, but not the object. (Then internally we've used ENODEV
> > > to indicate programmer error.)
> > > 
> > > ENOTTY too easy to confuse with the absent ioctl?
> > > 
> > > ENXIO is not bad, basically says the remote channel does not support the
> > > operation.
> > 
> > "ENXIO" looks fine to me. If everyone is onboard with this, we will replace "EINVAL" with it
> > in this patch, and also the ones in https://patchwork.freedesktop.org/patch/168810/
> > Thanks.
> 
> +1 on ENXIO. I reviewed usage in drm, and mostly it's used for probe time
> cases where the other endpoint wasn't found/didn't reply. It's a bit a
> stretch, but seems to fit best at least.

Daniel, I think you've just signed up for writing a nice section of
kerneldoc about this ;) Include the reasoning too, then it'll be easier
to be consistent in the future.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-08-18  8:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15  8:42 [PATCH] drm/i915: Return -EPERM when i915_gem_mmap_ioctl handling prime objects Tina Zhang
2017-08-15 10:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-15 10:49 ` [PATCH] " Daniel Vetter
2017-08-15 13:18   ` Chris Wilson
2017-08-15 14:25     ` Daniel Vetter
2017-08-15 14:32       ` Chris Wilson
2017-08-15 14:35         ` Chris Wilson
2017-08-15 14:48           ` Daniel Vetter
2017-08-15 15:01             ` Chris Wilson
2017-08-16  3:26               ` Zhang, Tina
2017-08-18  8:03                 ` Daniel Vetter
2017-08-18  8:40                   ` Joonas Lahtinen [this message]
2017-08-15 13:37 ` Joonas Lahtinen

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=1503045600.14144.3.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=tina.zhang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).