From fa89be96e845de705eed6edd01ecb79d46ee21c7 Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Fri, 9 Oct 2026 11:37:44 +0200 Subject: [PATCH] docs: dmaengine: clarify ordering rules around cookie completion Sashiko pointed in [1] about the cookie completion order. It is good to Document that for ensuring that dma buffer is flushed and no stale data is seeing by consumer, we need to make sure such action is taken before drivers invoke dma cookie completion. [1]: https://lore.kernel.org/r/20260917072507.5BDB61F000FF@smtp.kernel.org Reviewed-by: Frank Li Reviewed-by: Dave Jiang Reviewed-by: Wolfram Sang Link: https://patch.msgid.link/20261009093745.539924-1-vkoul@kernel.org Signed-off-by: Vinod Koul --- Documentation/driver-api/dmaengine/provider.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/driver-api/dmaengine/provider.rst b/Documentation/driver-api/dmaengine/provider.rst index 2897ade67b39..be47852e5a0f 100644 --- a/Documentation/driver-api/dmaengine/provider.rst +++ b/Documentation/driver-api/dmaengine/provider.rst @@ -557,6 +557,11 @@ dma_cookie_t - Not really relevant any more since the introduction of ``virt-dma`` that abstracts it away. +- dmaengine drivers need to ensure buffers are flushed before invoking + vchan_cookie_complete() or dma_cookie_complete(). This would imply a call + to unmapping buffers or any such architecture calls to ensure caller seeing + buffers are flushed is done before invoking these calls. + dma_vec - A small structure that contains a DMA address and length.