On Fri, Jan 06, 2023 at 05:17:16PM +0100, Markus Stockhausen wrote: > > Thanks, I need to check this again. CPU sets ownership bit in that > descriptor to OWNED_BY_ASIC and after processing we expect that engine > has set it back to OWNED_BY_CPU. So bidirectional operation is somehow > needed. For each bi-directional mapping, you must call dma_sync_single_for_cpu before you read what the hardware has just written. Then you make your changes, and once you are done you do dma_sync_single_for_device Note that you must ensure that the hardware does not modify the memory area after you have called dma_sync_single_for_cpu and before the next dma_sync_single_for_device call. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt