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 +, 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 hardware dma coherent support? >

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

2020-09-27 Thread Christoph Hellwig
On Sun, Sep 27, 2020 at 07:58:29AM +, 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 hardware dma coherent support? If your treat the memo

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 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 which used __get_free_pages and dma_map_singl

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

2020-09-26 Thread Christoph Hellwig
> +#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. > + vdev->vvr[i].vrh.vring.used = > + (void __force *)vpdev->hw_ops->remap( And

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

2020-09-25 Thread Greg KH
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 which used __get_free_pages and dma_map_single only > apply to coherent platforms. > > Sign

[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/mi