Skip to content

Commit f9dac92

Browse files
fengidrikuba-moo
authored andcommitted
virtio_ring: enable premapped mode whatever use_dma_api
Now, we have virtio DMA APIs, the driver can be the premapped mode whatever the virtio core uses dma api or not. So remove the limit of checking use_dma_api from virtqueue_set_dma_premapped(). Signed-off-by: Xuan Zhuo <[email protected]> Acked-by: Jason Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6e62702 commit f9dac92

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/virtio/virtio_ring.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,7 +2782,7 @@ EXPORT_SYMBOL_GPL(virtqueue_resize);
27822782
*
27832783
* Returns zero or a negative error.
27842784
* 0: success.
2785-
* -EINVAL: vring does not use the dma api, so we can not enable premapped mode.
2785+
* -EINVAL: too late to enable premapped mode, the vq already contains buffers.
27862786
*/
27872787
int virtqueue_set_dma_premapped(struct virtqueue *_vq)
27882788
{
@@ -2798,11 +2798,6 @@ int virtqueue_set_dma_premapped(struct virtqueue *_vq)
27982798
return -EINVAL;
27992799
}
28002800

2801-
if (!vq->use_dma_api) {
2802-
END_USE(vq);
2803-
return -EINVAL;
2804-
}
2805-
28062801
vq->premapped = true;
28072802
vq->do_unmap = false;
28082803

0 commit comments

Comments
 (0)