Re: [PATCH] drm/virtio: fix ring free check

2020-02-06 Thread Gerd Hoffmann
Hi, > > + indirect = virtio_has_feature(vgdev->vdev, > > VIRTIO_RING_F_INDIRECT_DESC); > > + vqcnt = indirect ? 1 : elemcnt; > Is the feature dynamic and require the lock held? If not, the result > can be cached and the fixup can happen before grabbing the lock Not dynamic, so

Re: [PATCH] drm/virtio: fix ring free check

2020-02-06 Thread Chia-I Wu
On Thu, Feb 6, 2020 at 3:14 AM Gerd Hoffmann wrote: > > If the virtio device supports indirect ring descriptors we need only one > ring entry for the whole command. Take that into account when checking > whenever the virtqueue has enough free entries for our command. > > Signed-off-by: Gerd

[PATCH] drm/virtio: fix ring free check

2020-02-06 Thread Gerd Hoffmann
If the virtio device supports indirect ring descriptors we need only one ring entry for the whole command. Take that into account when checking whenever the virtqueue has enough free entries for our command. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 9 ++--- 1