From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Lizhi Hou <lizhi.hou@amd.com>, Brian Xu <brian.xu@amd.com>,
Raj Kumar Rampelli <raj.kumar.rampelli@amd.com>,
Vinod Koul <vkoul@kernel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Michal Simek <monstr@monstr.eu>,
dmaengine@vger.kernel.org,
Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v2 2/4] dmaengine: xilinx: xdma: Clarify the logic between cyclic/sg modes
Date: Thu, 30 Nov 2023 12:13:13 +0100 [thread overview]
Message-ID: <20231130111315.729430-3-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20231130111315.729430-1-miquel.raynal@bootlin.com>
We support both modes, but they perform totally different taks in the
interrupt handler. Clarify what shall be done in each case.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/dma/xilinx/xdma.c | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index 2c9c72d4b5a2..4efef1b5f89c 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -765,26 +765,23 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
regmap_write(xdev->rmap, xchan->base + XDMA_CHAN_STATUS, st);
vchan_cyclic_callback(vd);
- goto out;
- }
-
- desc->completed_desc_num += complete_desc_num;
+ } else {
+ desc->completed_desc_num += complete_desc_num;
- /*
- * if all data blocks are transferred, remove and complete the request
- */
- if (desc->completed_desc_num == desc->desc_num) {
- list_del(&vd->node);
- vchan_cookie_complete(vd);
- goto out;
- }
+ /* if all data blocks are transferred, remove and complete the request */
+ if (desc->completed_desc_num == desc->desc_num) {
+ list_del(&vd->node);
+ vchan_cookie_complete(vd);
+ goto out;
+ }
- if (desc->completed_desc_num > desc->desc_num ||
- complete_desc_num != XDMA_DESC_BLOCK_NUM * XDMA_DESC_ADJACENT)
- goto out;
+ if (desc->completed_desc_num > desc->desc_num ||
+ complete_desc_num != XDMA_DESC_BLOCK_NUM * XDMA_DESC_ADJACENT)
+ goto out;
- /* transfer the rest of data (SG only) */
- xdma_xfer_start(xchan);
+ /* transfer the rest of data */
+ xdma_xfer_start(xchan);
+ }
out:
spin_unlock(&xchan->vchan.lock);
--
2.34.1
next prev parent reply other threads:[~2023-11-30 11:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 11:13 [PATCH v2 0/4] dmaengine: xilinx: Misc (cyclic) transfers fixes Miquel Raynal
2023-11-30 11:13 ` [PATCH v2 1/4] dmaengine: xilinx: xdma: Fix the count of elapsed periods in cyclic mode Miquel Raynal
2023-11-30 11:13 ` Miquel Raynal [this message]
2023-11-30 11:13 ` [PATCH v2 3/4] dmaengine: xilinx: xdma: Better handling of the busy variable Miquel Raynal
2023-11-30 11:13 ` [PATCH v2 4/4] dmaengine: xilinx: xdma: Add terminate_all/synchronize callbacks Miquel Raynal
2023-11-30 17:28 ` Lizhi Hou
2023-11-30 19:06 ` Jan Kuliga
2023-11-30 19:23 ` Miquel Raynal
2023-12-04 9:34 ` Jan Kuliga
2023-12-04 11:02 ` Miquel Raynal
2023-12-04 13:13 ` Jan Kuliga
2023-12-04 14:36 ` Miquel Raynal
2023-12-04 16:41 ` Lizhi Hou
2023-12-08 14:27 ` Jan Kuliga
2023-12-21 16:30 ` [PATCH v2 0/4] dmaengine: xilinx: Misc (cyclic) transfers fixes Vinod Koul
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=20231130111315.729430-3-miquel.raynal@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=brian.xu@amd.com \
--cc=dmaengine@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=monstr@monstr.eu \
--cc=raj.kumar.rampelli@amd.com \
--cc=thomas.petazzoni@bootlin.com \
--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