Skip to content

Commit 77b19d0

Browse files
Shi-Shenghuivinodkoul
authored andcommitted
dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
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>
1 parent 2e7b5cf commit 77b19d0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/dma/dw-edma/dw-edma-core.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ static int dw_edma_irq_request(struct dw_edma *dw,
844844
{
845845
struct dw_edma_chip *chip = dw->chip;
846846
struct device *dev = dw->chip->dev;
847+
struct msi_desc *msi_desc;
847848
u32 wr_mask = 1;
848849
u32 rd_mask = 1;
849850
int i, err = 0;
@@ -895,9 +896,12 @@ static int dw_edma_irq_request(struct dw_edma *dw,
895896
&dw->irq[i]);
896897
if (err)
897898
goto err_irq_free;
898-
899-
if (irq_get_msi_desc(irq))
899+
msi_desc = irq_get_msi_desc(irq);
900+
if (msi_desc) {
900901
get_cached_msi_msg(irq, &dw->irq[i].msi);
902+
if (!msi_desc->pci.msi_attrib.is_msix)
903+
dw->irq[i].msi.data = dw->irq[0].msi.data + i;
904+
}
901905
}
902906

903907
dw->nr_irqs = i;

0 commit comments

Comments
 (0)