Re: [PATCH 3/3] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT

From: Jacob Keller
Date: Fri Sep 29 2023 - 13:19:56 EST




On 9/29/2023 10:00 AM, Chris Leech wrote:
> Make use of the new UIO_MEM_DMA_COHERENT type to properly handle mmap
> for dma_alloc_coherent buffers.
>
> The cnic l2_ring and l2_buf mmaps have caused page refcount issues since
> the misuse of the __GFP_COMP flag was removed from their
> dma_alloc_coherent calls. Fix that by having the uio device use
> dma_mmap_coherent.
>
> The bnx2 and bnx2x status block allocations are also dma_alloc_coherent,
> and should use dma_mmap_coherent. They didn't allocate multiple pages,
> but also didn't seem to work correctly with an iommu enabled.
>
> Fixes: bb73955c0b1d ("cnic: don't pass bogus GFP_ flags to dma_alloc_coherent")
> Signed-off-by: Chris Leech <cleech@xxxxxxxxxx>
> ---


Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>