Skip to content

Commit 238f68a

Browse files
pcercueivinodkoul
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent e97dc74 commit 238f68a

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
@@ -411,10 +411,12 @@ static bool axi_dmac_transfer_done(struct axi_dmac_chan *chan,
411411
if (chan->hw_sg) {
412412
if (active->cyclic) {
413413
vchan_cyclic_callback(&active->vdesc);
414+
start_next = true;
414415
} else {
415416
list_del(&active->vdesc.node);
416417
vchan_cookie_complete(&active->vdesc);
417418
active = axi_dmac_active_desc(chan);
419+
start_next = !!active;
418420
}
419421
} else {
420422
do {
@@ -1000,6 +1002,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
10001002
struct axi_dmac *dmac;
10011003
struct regmap *regmap;
10021004
unsigned int version;
1005+
u32 irq_mask = 0;
10031006
int ret;
10041007

10051008
dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL);
@@ -1067,7 +1070,10 @@ static int axi_dmac_probe(struct platform_device *pdev)
10671070

10681071
dma_dev->copy_align = (dmac->chan.address_align_mask + 1);
10691072

1070-
axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, 0x00);
1073+
if (dmac->chan.hw_sg)
1074+
irq_mask |= AXI_DMAC_IRQ_SOT;
1075+
1076+
axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, irq_mask);
10711077

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

0 commit comments

Comments
 (0)