> > + dma_descriptor_unmap(&desc->async_tx); > > Does callback function still use these data? suppose should unmap after > callback return. Actually, the opposite is true. Drivers have been fixed to use this order. One example: commit 9b335978f7081cd4fe264709599a18073e12fee2 Author: Dave Jiang Date: Mon Jul 25 10:33:57 2016 -0700 dmaengine: fsldma: move unmap to before callback Completion callback should happen after dma_descriptor_unmap() has happened. This allow the cache invalidate to happen and ensure that the data accessed by the upper layer is in memory that was from DMA rather than stale data. On some architecture this is done by the hardware, however we should make the code consistent to not cause confusion. Signed-off-by: Dave Jiang Acked-by: Li Yang Signed-off-by: Vinod Koul