mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
virtio/vdrm: Fix lockup in vdrm_host_sync()
The vdrm_execbuf() missed to set the seqno field for requests sent to host. This causes vdrm_host_sync() to lock up due to the unset seqno in a case where two or more threads are using vdrm_execbuf() and vdrm_send_req() concurrently, like in this scenario: thread1: vdrm_send_req() shmem->seqno=1 req->seqno=2 thread2: vdrm_execbuf() shmem->seqno=1 req->seqno=0 thread1: vdrm_host_sync() shmem->seqno=0 req->seqno=2 Fix the lockup by setting the seqno in vdrm_execbuf(). Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27021>
This commit is contained in:
parent
2fa1979c66
commit
b9ad22d24e
1 changed files with 2 additions and 0 deletions
|
|
@ -109,6 +109,8 @@ vdrm_execbuf(struct vdrm_device *vdev, struct vdrm_execbuf_params *p)
|
|||
|
||||
simple_mtx_lock(&vdev->eb_lock);
|
||||
|
||||
p->req->seqno = ++vdev->next_seqno;
|
||||
|
||||
ret = vdev->funcs->flush_locked(vdev, NULL);
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue