Re: [PATCH for-next] RDMA/cxgb4: use dma_mmap_coherent() for mapping non-contiguous memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 07, 2024 at 02:39:57PM +0300, Leon Romanovsky wrote:
> > > It is perfect time to move to use rdma_user_mmap_io(), instead of
> > > open-code it in the driver.
> > 
> > rdma_user_mmap_io does not work on dma coherent allocations.
> 
> They used dma_mmap_coherent() to implement workaround, original cxgb4
> didn't use it and probably doesn't need too.

dma_mmap_coherent must be paired with dma_alloc_coherent.
It seems like cxgb4 uses a c4iw_mm_entry as a sort of generic
containers for objects that can be mmaped which are used on first come,
first serve bassis in c4iw_mmap (WTF???).  Not questioning the sanity
of the higher level logic here, which is ABI by now, the right fix
is to tag each entry with what is being mmaped, DMA_ALLOC, vs
uncached ba vs WC bar and remove the guessing logic there.

While we're it, pgprot_writecombine is generally available,
t4_pgprot_wc should go away aswell.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux