archive mirror
 help / color / mirror / Atom feed
From: Sherry Sun <>
Subject: [PATCH V4 0/2] Change vring space from nomal memory to dma coherent memory
Date: Mon, 26 Oct 2020 16:53:33 +0800	[thread overview]
Message-ID: <> (raw)

Changes in V4:
1. Change to use dma_mmap_coherent api for vop mmap callback. 
2. Add dp_mmap callback to map device page to userspace instead of get_dp_dma
3. Move all the dma related changes to patch 1.  
4. Kill the mic_dp_init/mic_dp_uninit and inline those into the callers as
Christoph suggested.
5. Keep the code following the 80-character line rule.
6. Add endian swap for vqconfig[i].address. 

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

Sherry Sun (2):
  misc: vop: change the way of allocating vring and device page
  misc: vop: do not allocate and reassign the used ring

 drivers/misc/mic/bus/vop_bus.h     |   2 +
 drivers/misc/mic/host/mic_boot.c   |   9 +++
 drivers/misc/mic/host/mic_main.c   |  43 +++--------
 drivers/misc/mic/vop/vop_debugfs.c |   2 -
 drivers/misc/mic/vop/vop_main.c    |  51 +++----------
 drivers/misc/mic/vop/vop_vringh.c  | 110 +++++++++--------------------
 include/uapi/linux/mic_common.h    |   5 +-
 7 files changed, 66 insertions(+), 156 deletions(-)


             reply	other threads:[~2020-10-26  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  8:53 Sherry Sun [this message]
2020-10-26  8:53 ` [PATCH V4 1/2] misc: vop: change the way of allocating vring and device page Sherry Sun
2020-10-27 10:40   ` Christoph Hellwig
2020-10-27 12:30     ` Sherry Sun
2020-10-26  8:53 ` [PATCH V4 2/2] misc: vop: do not allocate and reassign the used ring Sherry Sun
2020-10-26 10:35   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).