[PATCH 04/14] dmaengine: dma350: Check dma_cookie_status() ret code and txstate

Jisheng Zhang jszhang at kernel.org
Sat Aug 23 08:39:59 PDT 2025


If dma_cookie_status() returns DMA_COMPLETE, we can return immediately.

>From another side, the txstate is an optional parameter used to get a
struct with auxilary transfer status information. When not provided
the call to device_tx_status() should return the status of the dma
cookie. Return the status of dma cookie when the txstate optional
parameter is not provided.

Signed-off-by: Jisheng Zhang <jszhang at kernel.org>
---
 drivers/dma/arm-dma350.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c
index 96350d15ed85..17af9bb2a18f 100644
--- a/drivers/dma/arm-dma350.c
+++ b/drivers/dma/arm-dma350.c
@@ -377,6 +377,8 @@ static enum dma_status d350_tx_status(struct dma_chan *chan, dma_cookie_t cookie
 	u32 residue = 0;
 
 	status = dma_cookie_status(chan, cookie, state);
+	if (status == DMA_COMPLETE || !state)
+		return status;
 
 	spin_lock_irqsave(&dch->vc.lock, flags);
 	if (cookie == dch->cookie) {
-- 
2.50.0




More information about the linux-arm-kernel mailing list