Commit 238f68a0 authored by Paul Cercueil's avatar Paul Cercueil Committed by Vinod Koul

dmaengine: axi-dmac: Use only EOT interrupts when doing scatter-gather

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: default avatarPaul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20231215131313.23840-5-paul@crapouillou.netSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent e97dc743
...@@ -411,10 +411,12 @@ static bool axi_dmac_transfer_done(struct axi_dmac_chan *chan, ...@@ -411,10 +411,12 @@ static bool axi_dmac_transfer_done(struct axi_dmac_chan *chan,
if (chan->hw_sg) { if (chan->hw_sg) {
if (active->cyclic) { if (active->cyclic) {
vchan_cyclic_callback(&active->vdesc); vchan_cyclic_callback(&active->vdesc);
start_next = true;
} else { } else {
list_del(&active->vdesc.node); list_del(&active->vdesc.node);
vchan_cookie_complete(&active->vdesc); vchan_cookie_complete(&active->vdesc);
active = axi_dmac_active_desc(chan); active = axi_dmac_active_desc(chan);
start_next = !!active;
} }
} else { } else {
do { do {
...@@ -1000,6 +1002,7 @@ static int axi_dmac_probe(struct platform_device *pdev) ...@@ -1000,6 +1002,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
struct axi_dmac *dmac; struct axi_dmac *dmac;
struct regmap *regmap; struct regmap *regmap;
unsigned int version; unsigned int version;
u32 irq_mask = 0;
int ret; int ret;
dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL); dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL);
...@@ -1067,7 +1070,10 @@ static int axi_dmac_probe(struct platform_device *pdev) ...@@ -1067,7 +1070,10 @@ static int axi_dmac_probe(struct platform_device *pdev)
dma_dev->copy_align = (dmac->chan.address_align_mask + 1); 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)) { if (of_dma_is_coherent(pdev->dev.of_node)) {
ret = axi_dmac_read(dmac, AXI_DMAC_REG_COHERENCY_DESC); ret = axi_dmac_read(dmac, AXI_DMAC_REG_COHERENCY_DESC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment