Commit 99fb2b83 authored by Jason Wang's avatar Jason Wang Committed by Michael S. Tsirkin

vdpa: set dma mask for vDPA device

Setting DMA mask for vDPA device in case that there are virtqueue that
is not backed by DMA so the vDPA device could be advertised as the DMA
device that is used by DMA API for software emulated virtqueues.
Reviewed-by: default avatarEli Cohen <elic@nvidia.com>
Tested-by: default avatarEli Cohen <elic@nvidia.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Message-Id: <20230119061525.75068-5-jasowang@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent a1baedb1
...@@ -39,6 +39,11 @@ static int vdpa_dev_probe(struct device *d) ...@@ -39,6 +39,11 @@ static int vdpa_dev_probe(struct device *d)
u32 max_num, min_num = 1; u32 max_num, min_num = 1;
int ret = 0; int ret = 0;
d->dma_mask = &d->coherent_dma_mask;
ret = dma_set_mask_and_coherent(d, DMA_BIT_MASK(64));
if (ret)
return ret;
max_num = ops->get_vq_num_max(vdev); max_num = ops->get_vq_num_max(vdev);
if (ops->get_vq_num_min) if (ops->get_vq_num_min)
min_num = ops->get_vq_num_min(vdev); min_num = ops->get_vq_num_min(vdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment