All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/2] dma-fence: Propagate errors to dma-fence-array container
Date: Sun, 24 Mar 2019 13:18:30 +0000	[thread overview]
Message-ID: <20190324131831.11317-1-chris@chris-wilson.co.uk> (raw)

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

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
---
 drivers/dma-buf/dma-fence-array.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c
index a8c254497251..f931226616c0 100644
--- a/drivers/dma-buf/dma-fence-array.c
+++ b/drivers/dma-buf/dma-fence-array.c
@@ -46,6 +46,9 @@ static void dma_fence_array_cb_func(struct dma_fence *f,
 		container_of(cb, struct dma_fence_array_cb, cb);
 	struct dma_fence_array *array = array_cb->array;
 
+	if (atomic_read(&array->num_pending) > 0)
+		cmpxchg_local(&array->base.error, 0, f->error);
+
 	if (atomic_dec_and_test(&array->num_pending))
 		irq_work_queue(&array->work);
 	else
@@ -71,6 +74,7 @@ static bool dma_fence_array_enable_signaling(struct dma_fence *fence)
 		dma_fence_get(&array->base);
 		if (dma_fence_add_callback(array->fences[i], &cb[i].cb,
 					   dma_fence_array_cb_func)) {
+			cmpxchg(&array->base.error, 0, array->fences[i]->error);
 			dma_fence_put(&array->base);
 			if (atomic_dec_and_test(&array->num_pending))
 				return false;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-03-24 13:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24 13:18 Chris Wilson [this message]
2019-03-24 13:18 ` [PATCH 2/2] dma-fence: Report the composite sync_file status Chris Wilson
2019-03-24 21:15 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] dma-fence: Propagate errors to dma-fence-array container Patchwork
2019-03-25  2:21 ` [PATCH 1/2] " kbuild test robot
2019-03-25  8:07 ` [PATCH v2] " Chris Wilson
2019-04-08  9:00   ` Chris Wilson
2019-03-25  9:12 ` ✗ Fi.CI.BAT: failure for series starting with [v2] dma-fence: Propagate errors to dma-fence-array container (rev2) Patchwork
2019-03-25 11:08 ` [PATCH 1/2] dma-fence: Propagate errors to dma-fence-array container kbuild test robot

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=20190324131831.11317-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.