drm/virtio: fix vq wait_event condition
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 3 Apr 2018 09:59:04 +0000 (11:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 May 2018 19:58:13 +0000 (12:58 -0700)
commitc0ed8ece4ef395e8b1665fdba276b7285c44f0ab
tree0f436c5256be2c558b809f04ba9c6cc100cb6769
parent998d43ce034b98466e0aa1b8d56b6d524c7d0d4e
drm/virtio: fix vq wait_event condition

commit d02d270014f70dcab0117776b81a37b6fca745ae upstream.

Wait until we have enough space in the virt queue to actually queue up
our request.  Avoids the guest spinning in case we have a non-zero
amount of free entries but not enough for the request.

Cc: stable@vger.kernel.org
Reported-by: Alain Magloire <amagloire@blackberry.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180403095904.11152-1-kraxel@redhat.com
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/virtio/virtgpu_vq.c