Skip to content

Commit b725725

Browse files
pcercueinunojsa
authored andcommitted
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: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20231215131313.23840-5-paul@crapouillou.net Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 5048dfb commit b725725

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/dma/dma-axi-dmac.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,12 @@ static bool axi_dmac_transfer_done(struct axi_dmac_chan *chan,
414414
if (chan->hw_sg) {
415415
if (active->cyclic) {
416416
vchan_cyclic_callback(&active->vdesc);
417+
start_next = true;
417418
} else {
418419
list_del(&active->vdesc.node);
419420
vchan_cookie_complete(&active->vdesc);
420421
active = axi_dmac_active_desc(chan);
422+
start_next = !!active;
421423
}
422424
} else {
423425
do {
@@ -1026,6 +1028,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
10261028
struct axi_dmac *dmac;
10271029
struct regmap *regmap;
10281030
unsigned int version;
1031+
u32 irq_mask = 0;
10291032
int ret;
10301033

10311034
dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL);
@@ -1094,7 +1097,10 @@ static int axi_dmac_probe(struct platform_device *pdev)
10941097

10951098
dma_dev->copy_align = (dmac->chan.address_align_mask + 1);
10961099

1097-
axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, 0x00);
1100+
if (dmac->chan.hw_sg)
1101+
irq_mask |= AXI_DMAC_IRQ_SOT;
1102+
1103+
axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, irq_mask);
10981104

10991105
if (of_dma_is_coherent(pdev->dev.of_node)) {
11001106
ret = axi_dmac_read(dmac, AXI_DMAC_REG_COHERENCY_DESC);

0 commit comments

Comments
 (0)