RE: [PATCH V2 1/4] misc: vop: change the way of allocating vring

2020-09-29 Thread Sherry Sun
Hi Christoph, > > > + vr->va = dma_alloc_coherent(vop_dev(vdev), vr_size, > _addr, > > +GFP_KERNEL); > > Please stick to 80 character lines unless you have a really good reason not > to. Okay, will change it in V3. Regards Sherry

RE: [PATCH V2 2/4] misc: vop: do not allocate and reassign the used ring

2020-09-29 Thread Sherry Sun
Hi Christoph, > > diff --git a/include/uapi/linux/mic_common.h > > b/include/uapi/linux/mic_common.h index 504e523f702c..e680fe27af69 > > 100644 > > --- a/include/uapi/linux/mic_common.h > > +++ b/include/uapi/linux/mic_common.h > > @@ -56,8 +56,6 @@ struct mic_device_desc { > > * @vdev_reset:

RE: [PATCH V2 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys

2020-09-29 Thread Sherry Sun
Hi Christoph, > On Tue, Sep 29, 2020 at 04:44:24PM +0800, Sherry Sun wrote: > > The device page and vring should use consistent memory which are > > allocated by dma_alloc_coherent api, when user space wants to get its > > physical address, virt_to_phys cannot be used,

RE: [PATCH V2 4/4] misc: vop: mapping kernel memory to user space as noncached

2020-09-29 Thread Sherry Sun
Hi Christoph, > On Tue, Sep 29, 2020 at 04:44:25PM +0800, Sherry Sun wrote: > > Mapping kernel space memory to user space as noncached, since user > > space need check the updates of avail_idx and device page flags timely. > > > > Signed-off-by: Joakim Zhang &g

RE: [PATCH V2 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys

2020-09-30 Thread Sherry Sun
Hi Christoph, > On Tue, Sep 29, 2020 at 01:10:12PM +0000, Sherry Sun wrote: > > > > if (!offset) { > > > > - *pa = virt_to_phys(vpdev->hw_ops->get_dp(vpdev)); > > > > + if (vpdev->hw_ops->get_dp_dma)

RE: [PATCH V5 0/2] Change vring space from nomal memory to dma coherent memory

2020-10-28 Thread Sherry Sun
> Subject: Re: [PATCH V5 0/2] Change vring space from nomal memory to dma > coherent memory > > On Wed, Oct 28, 2020 at 06:05:28AM +0000, Sherry Sun wrote: > > Hi Greg, > > > > > Subject: Re: [PATCH V5 0/2] Change vring space from nomal memory to > > &

[PATCH V5 2/2] misc: vop: do not allocate and reassign the used ring

2020-10-28 Thread Sherry Sun
, will encounter a problem. When host finished with descriptor, it will update the used ring with putused_kern api, if reassign used ring at EP side, used ring will be io device memory for RC, use memcpy in putused_kern will cause kernel panic. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang

[PATCH V5 1/2] misc: vop: change the way of allocating vrings and device page

2020-10-28 Thread Sherry Sun
. Signed-off-by: Christoph Hellwig Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- 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_vringh.c | 135

RE: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring

2020-10-28 Thread Sherry Sun
Hi Sudeep, > Subject: Re: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used > ring > > On Wed, 2020-10-28 at 01:47 +0000, Sherry Sun wrote: > > Hi Vincent, > > > > > Subject: Re: [PATCH V3 2/4] misc: vop: do not allocate and reassign > > >

[PATCH V5 0/2] Change vring space from nomal memory to dma coherent memory

2020-10-28 Thread Sherry Sun
, 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 (2): misc: vop: change the way of allocating vrings

RE: [PATCH V3 1/4] misc: vop: change the way of allocating vring and device page

2020-10-25 Thread Sherry Sun
Hi Christoph, > > > static int mic_dp_init(struct mic_device *mdev) { > > - mdev->dp = kzalloc(MIC_DP_SIZE, GFP_KERNEL); > > + mdev->dp = dma_alloc_coherent(>pdev->dev, MIC_DP_SIZE, > > + >dp_dma_addr, GFP_KERNEL); > > if (!mdev->dp) > >

RE: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring

2020-10-25 Thread Sherry Sun
Hi Greg & Christoph, > Subject: Re: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used > ring > > On Thu, Oct 22, 2020 at 01:06:36PM +0800, Sherry Sun wrote: > > We don't need to allocate and reassign the used ring here and remove > > the used_addre

[PATCH V4 0/2] Change vring space from nomal memory to dma coherent memory

2020-10-26 Thread Sherry Sun
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 (2): misc: vop: change the way of allocating vring and device page misc: vop: do not allocate and reassign the used ring drivers

[PATCH V4 2/2] misc: vop: do not allocate and reassign the used ring

2020-10-26 Thread Sherry Sun
, will encounter a problem. When host finished with descriptor, it will update the used ring with putused_kern api, if reassign used ring at EP side, used ring will be io device memory for RC, use memcpy in putused_kern will cause kernel panic. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang

[PATCH V4 1/2] misc: vop: change the way of allocating vring and device page

2020-10-26 Thread Sherry Sun
. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- 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_vringh.c | 79 +-- 4 files changed, 55

RE: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non-Transparent Bridge

2020-11-12 Thread Sherry Sun
Hi Kishon, > Subject: Re: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non- > Transparent Bridge > > Hi Sherry, > > On 11/11/20 8:19 am, Sherry Sun wrote: > > Hi Kishon, > > > >> Subject: Re: [PATCH v7 15/18] NTB: Add support for EPF P

[PATCH V3 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys

2020-10-21 Thread Sherry Sun
in mic_vqconfig. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/bus/vop_bus.h| 2 ++ drivers/misc/mic/host/mic_boot.c | 8 drivers/misc/mic/vop/vop_vringh.c | 8 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/misc/mic/bus

[PATCH V3 4/4] misc: vop: mapping kernel memory to user space as noncached

2020-10-21 Thread Sherry Sun
Mapping kernel space memory to user space as noncached, since user space need check the updates of avail_idx and device page flags timely. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/vop/vop_vringh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH V3 0/4] Change vring space from nomal memory to dma coherent memory

2020-10-21 Thread Sherry Sun
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

[PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring

2020-10-21 Thread Sherry Sun
, will encounter a problem. When host finished with descriptor, it will update the used ring with putused_kern api, if reassign used ring at EP side, used ring will be io device memory for RC, use memcpy in putused_kern will cause kernel panic. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang

[PATCH V3 1/4] misc: vop: change the way of allocating vring and device page

2020-10-21 Thread Sherry Sun
dma_sync_single_for_cpu/device api to sync the changes of vring between EP and RC, which will cause memory synchronization problem for those devices which don't support hardware dma coherent. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/host/mic_main.c | 15

RE: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring

2020-10-27 Thread Sherry Sun
used > ring > > On Mon, Oct 26, 2020 at 03:04:45AM +, Sherry Sun wrote: > > Hi Greg & Christoph, > > > > > Subject: Re: [PATCH V3 2/4] misc: vop: do not allocate and reassign > > > the used ring > > > > > > On Thu, Oct 22, 2020 at 01:06:36PM

RE: [PATCH V4 1/2] misc: vop: change the way of allocating vring and device page

2020-10-27 Thread Sherry Sun
962d746d482c5bdd593 Mon Sep 17 00:00:00 > 2001 > From: Sherry Sun > Date: Mon, 26 Oct 2020 16:53:34 +0800 > Subject: misc: vop: change the way of allocating vring and device page > > Allocate vrings use dma_alloc_coherent is a common way in kernel. As the > memory interacted

RE: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non-Transparent Bridge

2020-11-09 Thread Sherry Sun
Hi Kishon, > Subject: Re: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non- > Transparent Bridge > > Hi Sherry, > > On 09/11/20 3:07 pm, Sherry Sun wrote: > > Hi Kishon, > > > >> Subject: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non-

RE: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non-Transparent Bridge

2020-11-10 Thread Sherry Sun
Hi Kishon, > Subject: Re: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non- > Transparent Bridge > > Hi Sherry, Arnd, > > On 10/11/20 8:29 pm, Arnd Bergmann wrote: > > On Tue, Nov 10, 2020 at 3:20 PM Kishon Vijay Abraham I > wrote: > >> O

RE: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non-Transparent Bridge

2020-11-09 Thread Sherry Sun
Hi Kishon, > Subject: [PATCH v7 15/18] NTB: Add support for EPF PCI-Express Non- > Transparent Bridge > > From: Kishon Vijay Abraham I > > Add support for EPF PCI-Express Non-Transparent Bridge (NTB) device. > This driver is platform independent and could be used by any platform which > have

[PATCH 0/4] Fix some bugs of the vop driver and mpssd user space tool

2020-09-25 Thread Sherry Sun
This patchset fix some bugs about the vop driver and Intel MIC user space tool -- mpssd. Sherry Sun (4): samples: mpssd: fix the build errors when enable DEBUG in mpssd.c misc: vop: build VOP based on CONFIG_VOP misc: vop: add round_up(x,4) for vring_size to avoid kernel panic mic: vop

[PATCH 1/4] samples: mpssd: fix the build errors when enable DEBUG in mpssd.c

2020-09-25 Thread Sherry Sun
); ^~~~ mpssd.c:361:1: note: expected ‘struct mic_copy_desc *’ but argument is of type ‘struct mic_copy_desc’ disp_iovec(struct mic_info *mic, struct mic_copy_desc *copy, ^~ Signed-off-by: Sherry Sun --- samples/mic/mpssd/mpssd.c | 20 ++-- 1 file

[PATCH 3/4] misc: vop: add round_up(x,4) for vring_size to avoid kernel panic

2020-09-25 Thread Sherry Sun
struct _mic_vring_info. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_main.c | 2 +- drivers/misc/mic/vop/vop_vringh.c | 4 ++-- samples/mic/mpssd/mpssd.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/misc/mic/vop/vop_

[PATCH 4/4] mic: vop: copy data to kernel space then write to io memory

2020-09-25 Thread Sherry Sun
Read and write io memory should address align on ARCH ARM. Change to use memcpy_toio to avoid kernel panic caused by the address un-align issue. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_vringh.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion

[PATCH 2/4] misc: vop: build VOP based on CONFIG_VOP

2020-09-25 Thread Sherry Sun
Build module or builtin VOP based on CONFIG_VOP macro. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/vop/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mic/vop/Makefile b/drivers/misc/mic/vop/Makefile index 579da3868c8e

[PATCH 0/5] Add noncoherent platform support for vop driver

2020-09-25 Thread Sherry Sun
Change the way of allocating vring to support noncoherent platform for vop driver, and add some related dma changes to make sure noncoherent platform works well. Sherry Sun (5): misc: vop: change the way of allocating vring for noncoherent platform misc: vop: change the way of allocating

[PATCH 5/5] misc: vop: mapping kernel memory to user space as noncached

2020-09-25 Thread Sherry Sun
Mapping kernel space memory to user space as noncached for noncoherent platform, since user space need check avail_idx and device page flags timely. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/vop/vop_vringh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for nocoherent platform

2020-09-25 Thread Sherry Sun
Set VIRTIO_F_ACCESS_PLATFORM feature for nocoherent platform, since it needs the DMA API for virtio. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/misc/mic/vop/vop_main.c b/drivers/misc

[PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform

2020-09-25 Thread Sherry Sun
For noncoherent platform, we should allocate vring through dma_alloc_coherent api to ensure timely synchronization of vring. The orginal way which used __get_free_pages and dma_map_single only apply to coherent platforms. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc

[PATCH 2/5] misc: vop: change the way of allocating used ring

2020-09-25 Thread Sherry Sun
finished with descriptor, it will update the used ring with putused_kern function, if reassign used ring at EP side, used ring will be io device memory for RC, use memcpy in putused_kern will cause kernel panic. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop

[PATCH 3/5] misc: vop: simply return the saved dma address instead of virt_to_phys

2020-09-25 Thread Sherry Sun
. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/bus/vop_bus.h| 2 ++ drivers/misc/mic/host/mic_boot.c | 8 drivers/misc/mic/vop/vop_vringh.c | 12 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mic/bus

[PATCH 0/3] Add module autoprobing support for vop and cosm driver

2020-09-25 Thread Sherry Sun
Add module autoprobing support for vop and cosm driver, when the vop/cosm device appears, the driver will be autoloaded. Sherry Sun (3): mic: vop: fix a written error in MODULE_DEVICE_TABLE mic: vop: module autoprobing support for vop drivers mic: cosm: module autoprobing support for cosm

[PATCH 3/3] mic: cosm: module autoprobing support for cosm driver

2020-09-25 Thread Sherry Sun
Add uevent callback for cosm_bus and add cosm_device_id for cosm driver which is needed for MODULE_DEVICE_TABLE. Also adding struct cosm_device_id in devicetable-offsets.c and the cosm entry point in file2alias.c. Cosm driver will be autoloaded when cosm device appears. Signed-off-by: Sherry Sun

[PATCH 1/3] mic: vop: fix a written error in MODULE_DEVICE_TABLE

2020-09-25 Thread Sherry Sun
For vop bus, the first parameter should be vop in MODULE_DEVICE_TABLE. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mic/vop/vop_main.c b/drivers/misc/mic/vop/vop_main.c

[PATCH 2/3] mic: vop: module autoprobing support for vop drivers

2020-09-25 Thread Sherry Sun
Add vop autoprobing support to MODULE_DEVICE_TABLE() by adding info about struct vop_device_id in devicetable-offsets.c and add a vop entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is vop. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers

RE: [PATCH 4/4] mic: vop: copy data to kernel space then write to io memory

2020-09-25 Thread Sherry Sun
Hi Arnd, > Subject: Re: [PATCH 4/4] mic: vop: copy data to kernel space then write to io > memory > > On Fri, Sep 25, 2020 at 9:22 AM Sherry Sun wrote: > > > > > @@ -655,12 +656,15 @@ static int vop_virtio_copy_from_user(struct > vop_vdev *vdev, void __user *ubuf,

RE: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring

2020-10-28 Thread Sherry Sun
Hi Vincent, > Subject: Re: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used > ring > > On Tue, Oct 27, 2020 at 08:05:43AM +0100, Sherry Sun wrote: > > Can you help test the patch about removing the codes of reassign used > > ring, and comment on the impac

RE: [EXT] Re: [PATCH V5 0/2] Change vring space from nomal memory to dma coherent memory

2020-10-28 Thread Sherry Sun
20 at 10:17:39AM +, Andy Duan wrote: > > > > From: Greg KH Sent: Wednesday, > > > > October 28, 2020 3:07 PM > > > > > On Wed, Oct 28, 2020 at 06:05:28AM +, Sherry Sun wrote: > > > > > > Hi Greg, > > > > > > > &g

RE: [PATCH V5 0/2] Change vring space from nomal memory to dma coherent memory

2020-10-28 Thread Sherry Sun
Hi Greg, > Subject: Re: [PATCH V5 0/2] Change vring space from nomal memory to dma > coherent memory > > On Wed, Oct 28, 2020 at 10:03:03AM +0800, Sherry Sun wrote: > > Changes in V5: > > 1. Reorganize the vop_mmap function code in patch 1, which is done by > Christop

RE: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used ring

2020-10-28 Thread Sherry Sun
Hi Arnd, > Subject: Re: [PATCH V3 2/4] misc: vop: do not allocate and reassign the used > ring > > (resending from the kernel.org address after getting bounces again) > > On Wed, Oct 28, 2020 at 7:29 AM Sherry Sun wrote: > > > Subject: Re: [PATCH V3 2/4] misc: vop: d

RE: [PATCH 0/5] Add noncoherent platform support for vop driver

2020-09-26 Thread Sherry Sun
Hi Arnd, > Subject: Re: [PATCH 0/5] Add noncoherent platform support for vop driver > > On Fri, Sep 25, 2020 at 9:27 AM Sherry Sun wrote: > > > > Change the way of allocating vring to support noncoherent platform for > > vop driver, and add some related dma chang

RE: [PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform

2020-09-27 Thread Sherry Sun
Hi Greg, > -Original Message- > On Fri, Sep 25, 2020 at 03:26:26PM +0800, Sherry Sun wrote: > > For noncoherent platform, we should allocate vring through > > dma_alloc_coherent api to ensure timely synchronization of vring. > > The orginal way whi

RE: [PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for nocoherent platform

2020-09-27 Thread Sherry Sun
Hi Greg, > -Original Message- > From: Greg KH > Sent: 2020年9月25日 20:17 > To: Sherry Sun > Cc: sudeep.d...@intel.com; ashutosh.di...@intel.com; a...@arndb.de; > wang.y...@zte.com.cn; huang.ziji...@zte.com.cn; > rikard.falkeb...@gmail.com; lee.jo...@linaro.org; m

RE: [PATCH 3/5] misc: vop: simply return the saved dma address instead of virt_to_phys

2020-09-27 Thread Sherry Sun
Hi Greg, > -Original Message- > On Fri, Sep 25, 2020 at 03:26:28PM +0800, Sherry Sun wrote: > > For noncoherent platform, the device page and vring should allocated > > by dma_alloc_coherent, when user space wants to get its physical > > address, virt_to_phys canno

RE: [PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform

2020-09-27 Thread Sherry Sun
Hi Christoph, > > +#include > > This header must not be included in drivers. > > > > > + if (dev_is_dma_coherent(vop_dev(vdev))) > > And this API must not be used in drivers either. Thanks for your reply. Can you explain why we cannot use the API and header above in drivers? And do

RE: [PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for nocoherent platform

2020-09-27 Thread Sherry Sun
Hi Christoph, > On Fri, Sep 25, 2020 at 03:26:29PM +0800, Sherry Sun wrote: > > Set VIRTIO_F_ACCESS_PLATFORM feature for nocoherent platform, since it > > needs the DMA API for virtio. > > Given that VOP is a plug-in PCIe card VIRTIO_F_ACCESS_PLATFORM must > always be

RE: [PATCH 1/3] mic: vop: fix a written error in MODULE_DEVICE_TABLE

2020-09-27 Thread Sherry Sun
Hi Greg, > -Original Message- > From: Greg KH > Sent: 2020年9月27日 18:29 > To: Sherry Sun > Cc: sudeep.d...@intel.com; ashutosh.di...@intel.com; a...@arndb.de; > masahi...@kernel.org; michal.l...@markovi.net; lee.jo...@linaro.org; > rikard.falkeb...@gmail.com; m...@re

RE: [PATCH 1/3] mic: vop: fix a written error in MODULE_DEVICE_TABLE

2020-09-27 Thread Sherry Sun
Hi Greg, > On Sun, Sep 27, 2020 at 12:19:50PM +0000, Sherry Sun wrote: > > Hi Greg, > > > > > -Original Message- > > > From: Greg KH > > > Sent: 2020年9月27日 18:29 > > > To: Sherry Sun > > > Cc: sudeep.d...@intel.com; ashutos

RE: [PATCH 3/3] mic: cosm: module autoprobing support for cosm driver

2020-09-27 Thread Sherry Sun
Hi Greg, > > On Fri, Sep 25, 2020 at 03:31:58PM +0800, Sherry Sun wrote: > > Add uevent callback for cosm_bus and add cosm_device_id for cosm > > driver which is needed for MODULE_DEVICE_TABLE. Also adding struct > > cosm_device_id in devicetable-offsets.c

RE: [PATCH 4/5] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for nocoherent platform

2020-09-28 Thread Sherry Sun
Hi Christoph, > On Sun, Sep 27, 2020 at 08:05:07AM +0000, Sherry Sun wrote: > > Hi Christoph, > > > > > On Fri, Sep 25, 2020 at 03:26:29PM +0800, Sherry Sun wrote: > > > > Set VIRTIO_F_ACCESS_PLATFORM feature for nocoherent platform, > >

RE: [PATCH 1/5] misc: vop: change the way of allocating vring for noncoherent platform

2020-09-28 Thread Sherry Sun
Hi Christoph, > On Sun, Sep 27, 2020 at 07:58:29AM +0000, Sherry Sun wrote: > > Thanks for your reply. > > Can you explain why we cannot use the API and header above in drivers? > > And do you know if there are any APIs that could replace this to check the > device hardw

[PATCH V2 1/2] mic: vop: module autoprobing support for vop drivers

2020-09-29 Thread Sherry Sun
Add vop autoprobing support to MODULE_DEVICE_TABLE() by adding info about struct vop_device_id in devicetable-offsets.c and add a vop entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is vop. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers

[PATCH V2 2/2] mic: cosm: module autoprobing support for cosm driver

2020-09-29 Thread Sherry Sun
Add uevent callback for cosm_bus and add cosm_device_id for cosm driver which is needed for MODULE_DEVICE_TABLE. Also adding struct cosm_device_id in devicetable-offsets.c and the cosm entry point in file2alias.c. Cosm driver will be autoloaded when cosm device appears. Signed-off-by: Sherry Sun

[PATCH V2 0/2] Add module autoloading support for vop and cosm driver

2020-09-29 Thread Sherry Sun
Changes in V2: 1. Combine patch1 and patch2 in V1 together, as patch1 is a part of autoloading support for vop driver in patch2. Add module autoloading support for vop and cosm driver, when the vop/cosm device appears, the driver will be autoloaded. Sherry Sun (2): mic: vop: module autoprobing

[PATCH V2 0/4] Change vring space from nomal memory to dma coherent memory

2020-09-29 Thread Sherry Sun
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

[PATCH V2 4/4] misc: vop: mapping kernel memory to user space as noncached

2020-09-29 Thread Sherry Sun
Mapping kernel space memory to user space as noncached, since user space need check the updates of avail_idx and device page flags timely. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/vop/vop_vringh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH V2 1/4] misc: vop: change the way of allocating vring

2020-09-29 Thread Sherry Sun
to sync the changes of vring between EP and RC, which will cause memory synchronization problem for those devices which don't support hardware dma coherent. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/vop/vop_vringh.c | 39 +++ 1 file

[PATCH V2 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys

2020-09-29 Thread Sherry Sun
in mic_vqconfig. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/bus/vop_bus.h| 2 ++ drivers/misc/mic/host/mic_boot.c | 8 drivers/misc/mic/vop/vop_vringh.c | 11 +-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mic

[PATCH V2 2/4] misc: vop: do not allocate and reassign the used ring

2020-09-29 Thread Sherry Sun
, will encounter a problem. When host finished with descriptor, it will update the used ring with putused_kern api, if reassign used ring at EP side, used ring will be io device memory for RC, use memcpy in putused_kern will cause kernel panic. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang

[PATCH] misc: vop: set VIRTIO_F_ACCESS_PLATFORM for vop driver

2020-09-29 Thread Sherry Sun
Set VIRTIO_F_ACCESS_PLATFORM feature for vop driver, as the DMA mapping details shouldn't decide on the virtio implementation, but the host PCIe implementation. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_main.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH V2 2/4] misc: vop: build VOP based on CONFIG_VOP

2020-09-29 Thread Sherry Sun
Build module or builtin VOP based on CONFIG_VOP macro. Signed-off-by: Joakim Zhang Signed-off-by: Sherry Sun --- drivers/misc/mic/vop/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mic/vop/Makefile b/drivers/misc/mic/vop/Makefile index 579da3868c8e

[PATCH V2 1/4] samples: mpssd: fix the build errors when enable DEBUG

2020-09-29 Thread Sherry Sun
, __LINE__); ^~~~ mpssd.c:361:1: note: expected ???struct mic_copy_desc *??? but argument is of type ???struct mic_copy_desc??? disp_iovec(struct mic_info *mic, struct mic_copy_desc *copy, ^~ Signed-off-by: Sherry Sun --- samples/mic/mpssd/mpssd.c | 20

[PATCH V2 3/4] misc: vop: add round_up(x,4) for vring_size to avoid kernel panic

2020-09-29 Thread Sherry Sun
struct _mic_vring_info. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_main.c | 2 +- drivers/misc/mic/vop/vop_vringh.c | 4 ++-- samples/mic/mpssd/mpssd.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/misc/mic/vop/vop_

[PATCH V2 0/4] Fix some bugs of the vop driver and mpssd user space tool

2020-09-29 Thread Sherry Sun
Changes in V2: 1. Change the way of copy data from ubuf to dbuf in patch4. Reuse the allocated vvr->buf as the temp buffer and add a loop for multiple copies if there are too much data. This patchset fix some bugs about the vop driver and Intel MIC user space tool. Sherry Sun (4): samp

[PATCH V2 4/4] mic: vop: copy data to kernel space then write to io memory

2020-09-29 Thread Sherry Sun
Read and write io memory should address align on ARCH ARM. Change to use memcpy_toio to avoid kernel panic caused by the address un-align issue. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang --- drivers/misc/mic/vop/vop_vringh.c | 20 ++-- 1 file changed, 14 insertions

RE: [PATCH V2 4/4] misc: vop: mapping kernel memory to user space as noncached

2020-10-12 Thread Sherry Sun
Hi David, thanks for your information. Hi Christoph, please see my comments below. > Subject: RE: [PATCH V2 4/4] misc: vop: mapping kernel memory to user space > as noncached > > From: Christoph Hellwig > > Sent: 29 September 2020 11:29 > ... > > You can't call remap_pfn_range on memory returned

RE: [PATCH V2 0/2] Add module autoloading support for vop and cosm driver

2020-10-13 Thread Sherry Sun
for vop and cosm driver, when the > vop/cosm device appears, the driver will be autoloaded. > > Sherry Sun (2): > mic: vop: module autoprobing support for vop drivers > mic: cosm: module autoprobing support for cosm driver > > drivers/misc/mic/bus/cosm_bus.c | 8 +

RE: [PATCH V2 0/2] Add module autoloading support for vop and cosm driver

2020-10-13 Thread Sherry Sun
Hi Greg, > Subject: Re: [PATCH V2 0/2] Add module autoloading support for vop and > cosm driver > > On Tue, Oct 13, 2020 at 08:52:01AM +0000, Sherry Sun wrote: > > Gentle ping > > It's the merge window, sorry, this fell through the cracks before that > happened

RE: [PATCH V2 4/4] misc: vop: mapping kernel memory to user space as noncached

2020-10-19 Thread Sherry Sun
Hi Christoph, Gentle ping Can you give some suggestions on the limitations of dma_mmap_coherent api? Best regards Sherry > Subject: RE: [PATCH V2 4/4] misc: vop: mapping kernel memory to user space > as noncached > > Hi David, thanks for your information. > Hi Christoph, please see my