diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2020-02-05 21:19:45 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-02-06 13:55:08 +0300 |
commit | 58547d7d5c6f4c5d18a1719c87799d825741e64a (patch) | |
tree | b1ab25fcfb814ad8e4f3e4af02cee3caabef6dcd /drivers/gpu/drm/virtio | |
parent | e46e31cf5366d6ca81644d047be38022f0ff7946 (diff) | |
download | linux-58547d7d5c6f4c5d18a1719c87799d825741e64a.tar.xz |
drm/virtio: fix a wait_event condition
outcnt may be greater than 1 since commit e1218b8c0cc1 ("drm/virtio:
Use vmalloc for command buffer allocations.").
Fixes: e1218b8c0cc1 ("drm/virtio: Use vmalloc for command buffer allocations.")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Cc: David Riley <davidriley@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200205181955.202485-2-olvaffe@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_vq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 83f22933c3bb..301f47552aea 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -391,7 +391,8 @@ again: */ if (vq->num_free < 2 + outcnt) { spin_unlock(&vgdev->ctrlq.qlock); - wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= 3); + wait_event(vgdev->ctrlq.ack_queue, + vq->num_free >= 2 + outcnt); goto again; } |