Re: [PATCH V2] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-19 Thread Stephen Warren
On 12/19/18 12:25 AM, Christoph Hellwig wrote: On Tue, Dec 18, 2018 at 05:12:41PM -0700, Stephen Warren wrote: On 12/18/18 1:56 PM, Christoph Hellwig wrote: This goes in the right direction, but I think we need to stop abusing the scatterlist for the coherent mapping entirely. Something like t

Re: [PATCH V2] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-18 Thread Christoph Hellwig
On Tue, Dec 18, 2018 at 05:12:41PM -0700, Stephen Warren wrote: > On 12/18/18 1:56 PM, Christoph Hellwig wrote: >> This goes in the right direction, but I think we need to stop >> abusing the scatterlist for the coherent mapping entirely. Something >> like the patch below (based on yours): > > Oh,

Re: [PATCH V2] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-18 Thread Stephen Warren
On 12/18/18 1:56 PM, Christoph Hellwig wrote: This goes in the right direction, but I think we need to stop abusing the scatterlist for the coherent mapping entirely. Something like the patch below (based on yours): Oh, it was simple to get rid of the sg list usage than I thought; I'd assume

Re: [PATCH V2] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-18 Thread Christoph Hellwig
This goes in the right direction, but I think we need to stop abusing the scatterlist for the coherent mapping entirely. Something like the patch below (based on yours): diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c index 4b4351141b94..717ee2fad

[PATCH V2] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-18 Thread Stephen Warren
From: Stephen Warren This patch solves a crash at the time of mlx4 driver unload or system shutdown. The crash occurs because dma_alloc_coherent() returns one value in mlx4_alloc_icm_coherent(), but a different value is passed to dma_free_coherent() in mlx4_free_icm_coherent(). In turn this is be