linux/drivers/staging
Chris Wilson 18b862dcd5 dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()
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 c11e391da2
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
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1458331359-2634-1-git-send-email-chris@chris-wilson.co.uk
2016-03-19 11:03:49 +01:00
..
android dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() 2016-03-19 11:03:49 +01:00
board staging: board: armadillo800eva: Use "arm,pl390" 2015-12-18 10:21:10 +09:00
clocking-wizard
comedi STAGING: COMEDI: Using kernel types in plx9080.h 2015-12-21 16:02:21 -08:00
dgap
dgnc staging: dgnc: dgnc_cls.c: Replaced udelay by usleep_range 2015-12-21 15:52:34 -08:00
emxx_udc staging: emxx_udc: use list_first_entry_or_null() 2015-12-21 18:32:52 -08:00
fbtft
fsl-mc
fwserial Staging: fwserial: Declare fwtty_port_put as static 2015-11-15 20:02:47 -08:00
gdm72xx staging: gdm72xx: add userspace data struct 2015-12-26 17:13:33 -08:00
gdm724x staging: gdm724x: constify tty_port_operations structs 2015-12-26 17:13:33 -08:00
goldfish
gs_fpgaboot
iio Second set of IIO fixes for the 4.5 cycle. These ones are mostly 2016-02-01 13:08:26 -08:00
lustre Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
media [media] timblogiw: move to staging in preparation for removal 2016-02-19 08:10:33 -02:00
most staging: most: Delete an unnecessary check before the function call "module_put" 2015-11-15 20:02:47 -08:00
mt29f_spinand staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers 2016-01-07 10:23:41 -08:00
netlogic staging: netlogic: Fix build error due to missed API change 2016-01-10 22:06:58 -05:00
nvec
octeon Staging patches for 4.5-rc1 2016-01-13 10:13:36 -08:00
octeon-usb
olpc_dcon
panel Revert "Staging: panel: usleep_range is preferred over udelay" 2016-01-28 22:26:18 -08:00
rdma staging/rdma: remove deprecated ipath driver 2016-02-03 11:10:58 -05:00
rtl8188eu staging: rtl8188eu: goto removed 2015-11-15 20:02:47 -08:00
rtl8192e staging: rtl8192e: Remove unnecessary variable 2015-11-15 20:02:47 -08:00
rtl8192u
rtl8712 staging: rtl8712: rtl871x_mlme: Remove wrapper function 2015-11-15 20:02:47 -08:00
rtl8723au
rts5208
skein
slicoss
sm750fb
speakup Staging: speakup: Fix allyesconfig build on mn10300 2016-02-01 13:05:44 -08:00
ste_rmi4
unisys staging: unisys: better config switch comments 2015-11-25 08:42:14 -08:00
vme drivers: staging: vme: Deleted casting to (void *) 2015-11-24 15:30:50 -08:00
vt6655
vt6656 staging: vt6656: remove address from GPL text 2015-11-19 16:53:09 -08:00
wilc1000 staging: wilc1000: bug fix on memory free 2015-12-21 13:21:09 -08:00
wlan-ng Staging: wlan-ng: Remove unused function declaration 2015-11-15 20:02:47 -08:00
xgifb
Kconfig
Makefile
staging.c