All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Virtio ring works with DMA coherent memory
@ 2016-12-08  6:59 Wendy Liang
  2016-12-08  6:59 ` [PATCH 1/2] virtio_ring: Do not call dma_map_page if sg is already mapped Wendy Liang
  2016-12-08  6:59 ` [PATCH 2/2] rpmsg: DMA map sgs passed to virtio Wendy Liang
  0 siblings, 2 replies; 7+ messages in thread
From: Wendy Liang @ 2016-12-08  6:59 UTC (permalink / raw)
  To: jasowang, mst, virtualization, ohad, bjorn.andersson,
	linux-remoteproc
  Cc: Wendy Liang

RPMsg uses dma_alloc_coherent() to allocate memory to shared with the remote.
In this case, as there is no pages setup in the dma_alloc_coherent(),
we cannot get the physical address back from the virtual address, and thus,
we can set the sg_dma_addr to store the DMA address and mark it already DMA
mapped.

When virtio vring sees the sg_dma_addr is ready set, do not call dma_map_page().

The issue was once discussed here:
http://virtualization.linux-foundation.narkive.com/CfVP32Vy/rfc-0-4-rpmsg-fix-init-of-dma-able-virtqueues

Edgar E. Iglesias (1):
  rpmsg: DMA map sgs passed to virtio

Wendy Liang (1):
  virtio_ring: Do not call dma_map_page if sg is already mapped.

 drivers/rpmsg/virtio_rpmsg_bus.c | 22 +++++++++++++++++++---
 drivers/virtio/virtio_ring.c     |  6 ++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-09 18:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08  6:59 [PATCH 0/2] Virtio ring works with DMA coherent memory Wendy Liang
2016-12-08  6:59 ` [PATCH 1/2] virtio_ring: Do not call dma_map_page if sg is already mapped Wendy Liang
2016-12-08 16:46   ` Michael S. Tsirkin
2016-12-08 16:46     ` Michael S. Tsirkin
2016-12-09 18:19     ` Wendy Liang
2016-12-09 18:19       ` Wendy Liang
2016-12-08  6:59 ` [PATCH 2/2] rpmsg: DMA map sgs passed to virtio Wendy Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.