Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH V3 0/4]  Change vring space from nomal memory to dma coherent memory
@ 2020-10-22  5:06 Sherry Sun
  2020-10-22  5:06 ` [PATCH V3 1/4] misc: vop: change the way of allocating vring and device page Sherry Sun
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Sherry Sun @ 2020-10-22  5:06 UTC (permalink / raw)
  To: hch, sudeep.dutt, ashutosh.dixit, arnd, gregkh, kishon,
	lorenzo.pieralisi
  Cc: linux-kernel, linux-pci, linux-imx

Changes in V3:
1. Change the device page allocation method of the Intel mic layer in Patch 1 to
align with the vring allocation. 
2. Move the vring physical address changes in mmap callback from Prach 3 to 1.
3. Use must_be_zero instead of directly deleting used_address_updated in
Patch 2 to avoid the influence of ABI change.
(I tried to use dma_mmap_coherent api in Patch 4 as Christoph suggested, but
 met some issues explained here https://lore.kernel.org/patchwork/patch/1313327/,
 so there is no change to Patch 4, and still can't find a better way than
 patch 3)

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 and device page
  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/host/mic_main.c   | 15 ++----
 drivers/misc/mic/vop/vop_debugfs.c |  2 -
 drivers/misc/mic/vop/vop_main.c    | 48 +++--------------
 drivers/misc/mic/vop/vop_vringh.c  | 84 +++++++-----------------------
 include/uapi/linux/mic_common.h    |  5 +-
 7 files changed, 42 insertions(+), 122 deletions(-)

-- 
2.17.1


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

end of thread, back to index

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  5:06 [PATCH V3 0/4] Change vring space from nomal memory to dma coherent memory Sherry Sun
2020-10-22  5:06 ` [PATCH V3 1/4] misc: vop: change the way of allocating vring and device page Sherry Sun
2020-10-22  7:58   ` kernel test robot
2020-10-23  9:25   ` Christoph Hellwig
2020-10-26  2:54     ` Sherry Sun
2020-10-22  5:06 ` [PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring Sherry Sun
2020-10-22  8:53   ` kernel test robot
2020-10-23  9:26   ` Christoph Hellwig
2020-10-26  3:04     ` Sherry Sun
2020-10-27  6:28       ` gregkh
2020-10-22  5:06 ` [PATCH V3 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys Sherry Sun
2020-10-22  5:06 ` [PATCH V3 4/4] misc: vop: mapping kernel memory to user space as noncached Sherry Sun
2020-10-23  9:28   ` Christoph Hellwig

Linux-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git