]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
authorShenghui Shi <brody.shi@m2semi.com>
Mon, 9 Feb 2026 10:37:25 +0000 (18:37 +0800)
committerVinod Koul <vkoul@kernel.org>
Wed, 25 Feb 2026 11:02:11 +0000 (16:32 +0530)
When using MSI (not MSI-X) with multiple IRQs, the MSI data value
must be unique per vector to ensure correct interrupt delivery.
Currently, the driver fails to increment the MSI data per vector,
causing interrupts to be misrouted.

Fix this by caching the base MSI data and adjusting each vector's
data accordingly during IRQ setup.

Fixes: e63d79d1ff04 ("dmaengine: dw-edma: Add Synopsys DesignWare eDMA IP core driver")
Signed-off-by: Shenghui Shi <brody.shi@m2semi.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260209103726.414-1-brody.shi@m2semi.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw-edma/dw-edma-core.c

index e7d698b352d37186f0615d7073d4322e357a2f55..5397dbda4f72467cb5c68f71931e621bfd0c5743 100644 (file)
@@ -844,6 +844,7 @@ static int dw_edma_irq_request(struct dw_edma *dw,
 {
        struct dw_edma_chip *chip = dw->chip;
        struct device *dev = dw->chip->dev;
+       struct msi_desc *msi_desc;
        u32 wr_mask = 1;
        u32 rd_mask = 1;
        int i, err = 0;
@@ -895,9 +896,12 @@ static int dw_edma_irq_request(struct dw_edma *dw,
                                          &dw->irq[i]);
                        if (err)
                                goto err_irq_free;
-
-                       if (irq_get_msi_desc(irq))
+                       msi_desc = irq_get_msi_desc(irq);
+                       if (msi_desc) {
                                get_cached_msi_msg(irq, &dw->irq[i].msi);
+                               if (!msi_desc->pci.msi_attrib.is_msix)
+                                       dw->irq[i].msi.data = dw->irq[0].msi.data + i;
+                       }
                }
 
                dw->nr_irqs = i;