Commit 3cc3dd73 authored by Christian König's avatar Christian König

dma-buf: fix dma_fence_default_wait() signaling check

That check must now come after grabing the spinlock, not before.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Fixes: b96fb1e7 ("dma-buf: dma_fence_wait must enable signaling")
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220919120618.113332-1-christian.koenig@amd.com
parent ed712d30
...@@ -763,11 +763,11 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout) ...@@ -763,11 +763,11 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
unsigned long flags; unsigned long flags;
signed long ret = timeout ? timeout : 1; signed long ret = timeout ? timeout : 1;
if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
return ret;
spin_lock_irqsave(fence->lock, flags); spin_lock_irqsave(fence->lock, flags);
if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
goto out;
if (intr && signal_pending(current)) { if (intr && signal_pending(current)) {
ret = -ERESTARTSYS; ret = -ERESTARTSYS;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment