From: Paul Cercueil <paul@crapouillou.net>
To: Vinod Koul <vkoul@kernel.org>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Nuno Sá" <noname.nuno@gmail.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
"Paul Cercueil" <paul@crapouillou.net>
Subject: [PATCH 4/4] dmaengine: axi-dmac: Use only EOT interrupts when doing scatter-gather
Date: Mon, 4 Dec 2023 15:03:52 +0100 [thread overview]
Message-ID: <20231204140352.30420-5-paul@crapouillou.net> (raw)
In-Reply-To: <20231204140352.30420-1-paul@crapouillou.net>
Instead of notifying userspace in the end-of-transfer (EOT) interrupt
and program the hardware in the start-of-transfer (SOT) interrupt, we
can do both things in the EOT, allowing us to mask the SOT, and halve
the number of interrupts sent by the HDL core.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/dma/dma-axi-dmac.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 5109530b66de..beed91a8238c 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -415,6 +415,7 @@ static bool axi_dmac_transfer_done(struct axi_dmac_chan *chan,
list_del(&active->vdesc.node);
vchan_cookie_complete(&active->vdesc);
active = axi_dmac_active_desc(chan);
+ start_next = !!active;
}
} else {
do {
@@ -1000,6 +1001,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
struct axi_dmac *dmac;
struct regmap *regmap;
unsigned int version;
+ u32 irq_mask = 0;
int ret;
dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL);
@@ -1067,7 +1069,10 @@ static int axi_dmac_probe(struct platform_device *pdev)
dma_dev->copy_align = (dmac->chan.address_align_mask + 1);
- axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, 0x00);
+ if (dmac->chan.hw_sg)
+ irq_mask |= AXI_DMAC_IRQ_SOT;
+
+ axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, irq_mask);
if (of_dma_is_coherent(pdev->dev.of_node)) {
ret = axi_dmac_read(dmac, AXI_DMAC_REG_COHERENCY_DESC);
--
2.42.0
next prev parent reply other threads:[~2023-12-04 14:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 14:03 [PATCH 0/4] axi-dmac: Add support for scatter-gather transfers Paul Cercueil
2023-12-04 14:03 ` [PATCH 1/4] dmaengine: axi-dmac: Small code cleanup Paul Cercueil
2023-12-11 11:57 ` Vinod Koul
2023-12-11 12:15 ` Paul Cercueil
2023-12-12 4:34 ` Vinod Koul
2023-12-04 14:03 ` [PATCH 2/4] dmaengine: axi-dmac: Allocate hardware descriptors Paul Cercueil
2023-12-04 14:03 ` [PATCH 3/4] dmaengine: axi-dmac: Add support for scatter-gather transfers Paul Cercueil
2023-12-04 14:03 ` Paul Cercueil [this message]
2023-12-11 12:01 ` [PATCH 4/4] dmaengine: axi-dmac: Use only EOT interrupts when doing scatter-gather Vinod Koul
2023-12-11 12:20 ` Paul Cercueil
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=20231204140352.30420-5-paul@crapouillou.net \
--to=paul@crapouillou.net \
--cc=Michael.Hennerich@analog.com \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=noname.nuno@gmail.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