提交 08cd3d43 编写于 作者: B Ben Skeggs

drm/nouveau: fix thinko in channel locking in semaphore path

Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 21e86c1c
...@@ -393,23 +393,23 @@ nouveau_fence_sync(struct nouveau_fence *fence, ...@@ -393,23 +393,23 @@ nouveau_fence_sync(struct nouveau_fence *fence,
return nouveau_fence_wait(fence, NULL, false, false); return nouveau_fence_wait(fence, NULL, false, false);
} }
/* try to take wchan's mutex, if we can't take it right away /* try to take chan's mutex, if we can't take it right away
* we have to fallback to software sync to prevent locking * we have to fallback to software sync to prevent locking
* order issues * order issues
*/ */
if (!mutex_trylock(&wchan->mutex)) { if (!mutex_trylock(&chan->mutex)) {
free_semaphore(&sema->ref); free_semaphore(&sema->ref);
return nouveau_fence_wait(fence, NULL, false, false); return nouveau_fence_wait(fence, NULL, false, false);
} }
/* Make wchan wait until it gets signalled */ /* Make wchan wait until it gets signalled */
ret = emit_semaphore(wchan, NV_SW_SEMAPHORE_ACQUIRE, sema); ret = emit_semaphore(wchan, NV_SW_SEMAPHORE_ACQUIRE, sema);
mutex_unlock(&wchan->mutex);
if (ret) if (ret)
goto out; goto out;
/* Signal the semaphore from chan */ /* Signal the semaphore from chan */
ret = emit_semaphore(chan, NV_SW_SEMAPHORE_RELEASE, sema); ret = emit_semaphore(chan, NV_SW_SEMAPHORE_RELEASE, sema);
mutex_unlock(&chan->mutex);
out: out:
kref_put(&sema->ref, free_semaphore); kref_put(&sema->ref, free_semaphore);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册