diff options
author | Jiri Kosina <jkosina@suse.cz> | 2023-04-26 23:52:34 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2023-04-26 23:52:34 +0300 |
commit | cdc780f044a803aff8845b949f800f0f3d095d5f (patch) | |
tree | 6695a80568f6b4aef414070f17859f434e229957 /drivers/virtio/virtio_vdpa.c | |
parent | 38518593ec55e897abda4b4be77b2ec8ec4447d1 (diff) | |
parent | 37386669887d3f2ccf021322c5558353d20f2387 (diff) | |
download | linux-cdc780f044a803aff8845b949f800f0f3d095d5f.tar.xz |
Merge branch 'for-6.4/amd-sfh' into for-linus
- assorted functional fixes for amd-sfh driver (Basavaraj Natikar)
Diffstat (limited to 'drivers/virtio/virtio_vdpa.c')
-rw-r--r-- | drivers/virtio/virtio_vdpa.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 9670cc79371d..d7f5af62ddaa 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -135,6 +135,7 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index, { struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev); struct vdpa_device *vdpa = vd_get_vdpa(vdev); + struct device *dma_dev; const struct vdpa_config_ops *ops = vdpa->config; struct virtio_vdpa_vq_info *info; struct vdpa_callback cb; @@ -175,9 +176,15 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index, /* Create the vring */ align = ops->get_vq_align(vdpa); - vq = vring_create_virtqueue(index, max_num, align, vdev, - true, may_reduce_num, ctx, - virtio_vdpa_notify, callback, name); + + if (ops->get_vq_dma_dev) + dma_dev = ops->get_vq_dma_dev(vdpa, index); + else + dma_dev = vdpa_get_dma_dev(vdpa); + vq = vring_create_virtqueue_dma(index, max_num, align, vdev, + true, may_reduce_num, ctx, + virtio_vdpa_notify, callback, + name, dma_dev); if (!vq) { err = -ENOMEM; goto error_new_virtqueue; |