Commit dbc88dce authored by Suman Anna's avatar Suman Anna
Browse files

rpmsg: fill in dma fields for sgs passed to virtio

The virtio_rpmsg bus allocates the vring buffers using the
dma_alloc_coherent() API, and passes them to the virtio core
using the virtqueue_add_inbuf/outbuf() API. This API takes in a
scatterlist which is prepared using the returned virtual address
from the above dma allocation API. The virtio core expects the
descriptors to be allocated from linear address space in general,
but the dma_alloc_coherent() API can return virtual addresses from
the vmalloc range if the underlying memory is allocated from a
carveout or a CMA pool in highmem.

This patch fills in the dma fields of the scatterlist structure,
and uses the newly added virtqueue_add_inbuf/outbuf_rpmsg() API
to pass these to the virtio core, so that the virtio core can
use sg_dma_address() API instead of sg_phys() API and thereby
fill in properly the physical addresses of the vring buffers in
the vring transport.

Based on a RFC patch from Edgar E. Iglesias <edgar.iglesias@xilinx.com>,
http://marc.info/?l=linux-virtualization&m=143047903512230&w=2



Suggested-by: default avatarRussell King <linux@arm.linux.org.uk>
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent eef5dab8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment