intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Tiago Vignatti <tiago.vignatti@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: "Stéphane Marchesin" <marcheu@chromium.org>,
	"David Herrmann" <dh.herrmann@gmail.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH] dma-buf,drm,ion: Propagate error code from dma_buf_start_cpu_access()
Date: Mon, 21 Mar 2016 10:13:10 -0300	[thread overview]
Message-ID: <56EFF366.3080908@intel.com> (raw)
In-Reply-To: <1458331359-2634-1-git-send-email-chris@chris-wilson.co.uk>

On 03/18/2016 05:02 PM, Chris Wilson wrote:
> Drivers, especially i915.ko, can fail during the initial migration of a
> dma-buf for CPU access. However, the error code from the driver was not
> being propagated back to ioctl and so userspace was blissfully ignorant
> of the failure. Rendering corruption ensues.
>
> Whilst fixing the ioctl to return the error code from
> dma_buf_start_cpu_access(), also do the same for
> dma_buf_end_cpu_access().  For most drivers, dma_buf_end_cpu_access()
> cannot fail. i915.ko however, as most drivers would, wants to avoid being
> uninterruptible (as would be required to guarrantee no failure when
> flushing the buffer to the device). As userspace already has to handle
> errors from the SYNC_IOCTL, take advantage of this to be able to restart
> the syscall across signals.
>
> This fixes a coherency issue for i915.ko as well as reducing the
> uninterruptible hold upon its BKL, the struct_mutex.
>
> Fixes commit c11e391da2a8fe973c3c2398452000bed505851e
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Thu Feb 11 20:04:51 2016 -0200
>
>      dma-buf: Add ioctls to allow userspace to flush
>
> Testcase: igt/gem_concurrent_blit/*dmabuf*interruptible
> Testcase: igt/prime_mmap_coherency/ioctl-errors
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tiago Vignatti <tiago.vignatti@intel.com>
> Cc: Stéphane Marchesin <marcheu@chromium.org>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> CC: linux-media@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: devel@driverdev.osuosl.org

Reviewed-by: Tiago Vignatti <tiago.vignatti@intel.com>

Best regards,

Tiago

      parent reply	other threads:[~2016-03-21 13:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 20:02 [PATCH] dma-buf,drm,ion: Propagate error code from dma_buf_start_cpu_access() Chris Wilson
2016-03-19 10:09 ` [PATCH] dma-buf, drm, ion: " Daniel Vetter
2016-03-21  6:13   ` Sumit Semwal
2016-03-21  7:30     ` [PATCH] dma-buf: Update docs for SYNC ioctl Daniel Vetter
2016-03-21  7:35       ` Sumit Semwal
2016-03-21  7:40       ` Hans Verkuil
2016-03-21  7:50         ` Daniel Vetter
2016-03-21  7:51     ` Daniel Vetter
2016-03-21  7:53       ` Hans Verkuil
2016-03-21 12:26       ` David Herrmann
2016-03-21 17:14         ` Daniel Vetter
2016-03-23 11:30           ` David Herrmann
2016-03-23 11:56             ` Chris Wilson
2016-03-23 15:32               ` David Herrmann
2016-03-23 15:42                 ` Chris Wilson
2016-03-28 19:42                   ` Tiago Vignatti
2016-03-29  9:47                     ` David Herrmann
2016-03-29 17:20                       ` Tiago Vignatti
2016-03-21 13:16       ` Tiago Vignatti
2016-03-21 13:13 ` Tiago Vignatti [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=56EFF366.3080908@intel.com \
    --to=tiago.vignatti@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dh.herrmann@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=sumit.semwal@linaro.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;
as well as URLs for NNTP newsgroup(s).