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 1/4] misc: vop: change the way of allocating vring and device page

2020-10-23 Thread Christoph Hellwig
> 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) > return -ENOMEM; > >

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

2020-10-22 Thread kernel test robot
Hi Sherry, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on char-misc/char-misc-testing] [also build test WARNING on soc/for-next linus/master v5.9 next-20201022] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch,

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

2020-10-21 Thread Sherry Sun
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, same as device page memory. The orginal way use __get_free_pages and dma_map_single to allocate and map vring, but not use