linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/4] Change vring space from nomal memory to dma coherent memory
@ 2020-09-29  8:44 Sherry Sun
  2020-09-29  8:44 ` [PATCH V2 1/4] misc: vop: change the way of allocating vring Sherry Sun
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Sherry Sun @ 2020-09-29  8:44 UTC (permalink / raw)
  To: hch, sudeep.dutt, ashutosh.dixit, arnd, gregkh, kishon,
	lorenzo.pieralisi
  Cc: linux-kernel, linux-pci, linux-imx

Changes in V2:
1. Remove dev_is_dma_coherent check as Christoph suggested in the patchset. 
2. Remove used_address_updated flags in Patch2.
3. Remove WARN_ON in Patch3 and return error code instead directly return -1.
4. Remove Patch4 as it is a separate patch now.
5. Add more detailed explanations in the commit of patches.

The original vop driver only supports dma coherent device, as it allocates and
maps vring by _get_free_pages and dma_map_single, but not use 
dma_sync_single_for_cpu/device to sync the updates of device_page/vring between
EP and RC, which will cause memory synchronization problem for device don't
support hardware dma coherent.

And allocate vrings use dma_alloc_coherent is a common way in kernel, as the
memory interacted between two systems should use consistent memory to avoid
caching effects. So here add noncoherent platform support for vop driver.
Also add some related dma changes to make sure noncoherent platform works
well.

Sherry Sun (4):
  misc: vop: change the way of allocating vring
  misc: vop: do not allocate and reassign the used ring
  misc: vop: simply return the saved dma address instead of virt_to_phys
  misc: vop: mapping kernel memory to user space as noncached

 drivers/misc/mic/bus/vop_bus.h     |  2 +
 drivers/misc/mic/host/mic_boot.c   |  8 +++
 drivers/misc/mic/vop/vop_debugfs.c |  2 -
 drivers/misc/mic/vop/vop_main.c    | 48 +++--------------
 drivers/misc/mic/vop/vop_vringh.c  | 83 +++++++-----------------------
 include/uapi/linux/mic_common.h    |  3 --
 6 files changed, 35 insertions(+), 111 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2020-10-20  1:33 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  8:44 [PATCH V2 0/4] Change vring space from nomal memory to dma coherent memory Sherry Sun
2020-09-29  8:44 ` [PATCH V2 1/4] misc: vop: change the way of allocating vring Sherry Sun
2020-09-29 10:23   ` Christoph Hellwig
2020-09-29 13:02     ` Sherry Sun
2020-09-29  8:44 ` [PATCH V2 2/4] misc: vop: do not allocate and reassign the used ring Sherry Sun
2020-09-29 10:24   ` Christoph Hellwig
2020-09-29 13:02     ` Sherry Sun
2020-09-29 14:28       ` David Laight
2020-09-29  8:44 ` [PATCH V2 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys Sherry Sun
2020-09-29 10:26   ` Christoph Hellwig
2020-09-29 13:10     ` Sherry Sun
2020-09-29 18:11       ` Christoph Hellwig
2020-09-30  7:30         ` Sherry Sun
2020-10-05 13:42           ` Christoph Hellwig
2020-09-29  8:44 ` [PATCH V2 4/4] misc: vop: mapping kernel memory to user space as noncached Sherry Sun
2020-09-29 10:28   ` Christoph Hellwig
2020-09-29 13:12     ` Sherry Sun
2020-09-29 15:39     ` David Laight
2020-10-13  2:02       ` Sherry Sun
2020-10-20  1:33         ` Sherry Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).