On Sat, Mar 03, 2018 at 07:19:06PM +0100, Fredrik Noring wrote: > Christoph, Alan, > > > If it is allocating / freeing this memory all the time in the hot path > > it should really use a dma pool (see include/ilinux/dmapool.h). > > The dma coherent APIs aren't really built for being called in the > > hot path. > > hcd_buffer_free uses a combination of dma pools and dma coherent APIs: > > ... > for (i = 0; i < HCD_BUFFER_POOLS; i++) { > if (size <= pool_max[i]) { > dma_pool_free(hcd->pool[i], addr, dma); > return; > } > } > dma_free_coherent(hcd->self.sysdev, size, addr, dma); > > Alan, can dma_free_coherent be delayed to a point when IRQs are enabled?
The point is that you should always use a pool, period. dma_alloc*/dma_free* are fundamentally expensive operations on my architectures, so if you call them from a fast path you are doing something wrong. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html