Skip to content

Commit

Permalink
rpmsg: virtio: allocate buffer from parent
Browse files Browse the repository at this point in the history
Remoteproc is now capable to create one specific sub-device per
virtio link to associate a dedicated memory pool.
This implies to change device used by virtio_rpmsg for
buffer allocation from grand-parent to parent.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Loic Pallardy authored and Bjorn Andersson committed Feb 21, 2019
1 parent 3df52ed commit d999b62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/rpmsg/virtio_rpmsg_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ static int rpmsg_probe(struct virtio_device *vdev)
total_buf_space = vrp->num_bufs * vrp->buf_size;

/* allocate coherent memory for the buffers */
bufs_va = dma_alloc_coherent(vdev->dev.parent->parent,
bufs_va = dma_alloc_coherent(vdev->dev.parent,
total_buf_space, &vrp->bufs_dma,
GFP_KERNEL);
if (!bufs_va) {
Expand Down Expand Up @@ -980,7 +980,7 @@ static int rpmsg_probe(struct virtio_device *vdev)
return 0;

free_coherent:
dma_free_coherent(vdev->dev.parent->parent, total_buf_space,
dma_free_coherent(vdev->dev.parent, total_buf_space,
bufs_va, vrp->bufs_dma);
vqs_del:
vdev->config->del_vqs(vrp->vdev);
Expand Down Expand Up @@ -1015,7 +1015,7 @@ static void rpmsg_remove(struct virtio_device *vdev)

vdev->config->del_vqs(vrp->vdev);

dma_free_coherent(vdev->dev.parent->parent, total_buf_space,
dma_free_coherent(vdev->dev.parent, total_buf_space,
vrp->rbufs, vrp->bufs_dma);

kfree(vrp);
Expand Down

0 comments on commit d999b62

Please sign in to comment.