dma-fence: Propagate errors to dma-fence-array container
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 11 Aug 2019 21:09:02 +0000 (22:09 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 12 Aug 2019 07:25:52 +0000 (08:25 +0100)
commit1f70b8b812f36c24112b3e56a32412522673e50e
tree0db1e9d7a32c5d3d250f9d3daa20d1c6345b6975
parente0d409ff16201e76e07ebb5ec942abfbaf21c661
dma-fence: Propagate errors to dma-fence-array container

When one of the array of fences is signaled, propagate its errors to the
parent fence-array (keeping the first error to be raised).

v2: Opencode cmpxchg_local to avoid compiler freakout.
v3: Be careful not to flag an error if we race against signal-on-any.
v4: Same applies to installing the signal cb.
v5: Use cmpxchg to only set the error once before using a nifty idea by
Christian to avoid changing the status after emitting the signal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190811210902.22112-1-chris@chris-wilson.co.uk
drivers/dma-buf/dma-fence-array.c