From: "Nuno Sá via B4 Relay" <devnull+nuno.sa.analog.com@kernel.org>
To: dmaengine@vger.kernel.org
Cc: Paul Cercueil <paul@crapouillou.net>,
Lars-Peter Clausen <lars@metafoo.de>,
Vinod Koul <vkoul@kernel.org>
Subject: [PATCH 1/4] dma: dma-axi-dmac: fix SW cyclic transfers
Date: Tue, 20 May 2025 14:31:51 +0100 [thread overview]
Message-ID: <20250520-dev-axi-dmac-fixes-v1-1-b849ea23f80b@analog.com> (raw)
In-Reply-To: <20250520-dev-axi-dmac-fixes-v1-0-b849ea23f80b@analog.com>
From: Nuno Sá <nuno.sa@analog.com>
If 'hw_cyclic' is false we should still be able to do cyclic transfers in
"software". That was not working for the case where 'desc->num_sgs' is 1
because 'chan->next_desc' is never set with the current desc which means
that the cyclic transfer only runs once and in the next SOT interrupt we
do nothing since vchan_next_desc() will return NULL.
Fix it by setting 'chan->next_desc' as soon as we get a new desc via
vchan_next_desc().
Fixes: 0e3b67b348b8 ("dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
drivers/dma/dma-axi-dmac.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 36943b0c6d603cbe38606b0d7bde02535f529a9a..2aa06f66624ba5749e7e7f24b55416f96064b82f 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -247,6 +247,7 @@ static void axi_dmac_start_transfer(struct axi_dmac_chan *chan)
return;
list_move_tail(&vdesc->node, &chan->active_descs);
desc = to_axi_dmac_desc(vdesc);
+ chan->next_desc = desc;
}
sg = &desc->sg[desc->num_submitted];
@@ -265,8 +266,6 @@ static void axi_dmac_start_transfer(struct axi_dmac_chan *chan)
else
chan->next_desc = NULL;
flags |= AXI_DMAC_FLAG_LAST;
- } else {
- chan->next_desc = desc;
}
sg->hw->id = axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID);
--
2.49.0
next prev parent reply other threads:[~2025-05-20 13:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 13:31 [PATCH 0/4] dma: dma-axi-dmac: fixes and improvements Nuno Sá via B4 Relay
2025-05-20 13:31 ` Nuno Sá via B4 Relay [this message]
2025-05-20 13:31 ` [PATCH 2/4] dma: dma-axi-dmac: fix HW scatter-gather not looking at the queue Nuno Sá via B4 Relay
2025-05-20 13:31 ` [PATCH 3/4] dma: dma-axi-dmac: support bigger than 32bits addresses Nuno Sá via B4 Relay
2025-05-20 13:31 ` [PATCH 4/4] dma: dma-axi-dmac: simplify axi_dmac_parse_dt() Nuno Sá via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250520-dev-axi-dmac-fixes-v1-1-b849ea23f80b@analog.com \
--to=devnull+nuno.sa.analog.com@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=nuno.sa@analog.com \
--cc=paul@crapouillou.net \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).