* [PATCH v3] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
@ 2026-01-31 10:45 Shi-Shenghui
2026-01-31 18:07 ` Frank Li
0 siblings, 1 reply; 2+ messages in thread
From: Shi-Shenghui @ 2026-01-31 10:45 UTC (permalink / raw)
To: Frank.Li, vkoul
Cc: manivannan.sadhasivam, dmaengine, linux-kernel, brody.shi,
kevin.song, qixiang.zhong, tom.hu, richard.yang
From: Shenghui Shi <brody.shi@m2semi.com>
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.
This issue was reproduced and tested on:
- Device: [20e0:2502] (rev 01)
- Kernel: 6.8.0-90-generic
Fixes: e63d79d1ff04 ("dmaengine: dw-edma: Add Synopsys DesignWare eDMA IP core driver")
Signed-off-by: Shenghui Shi <brody.shi@m2semi.com>
---
drivers/dma/dw-edma/dw-edma-core.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
index 8e5f7defa6b6..2b2a59fec053 100644
--- a/drivers/dma/dw-edma/dw-edma-core.c
+++ b/drivers/dma/dw-edma/dw-edma-core.c
@@ -844,11 +844,13 @@ 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;
u32 ch_cnt;
int irq;
+ bool is_msix = false;
ch_cnt = dw->wr_ch_cnt + dw->rd_ch_cnt;
@@ -895,9 +897,13 @@ 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);
+ is_msix = msi_desc && msi_desc->pci.msi_attrib.is_msix;
+ if (!is_msix && i > 0)
+ dw->irq[i].msi.data = dw->irq[0].msi.data + i;
+ }
}
dw->nr_irqs = i;
--
2.49.0.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
2026-01-31 10:45 [PATCH v3] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case Shi-Shenghui
@ 2026-01-31 18:07 ` Frank Li
0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-01-31 18:07 UTC (permalink / raw)
To: Shi-Shenghui
Cc: vkoul, manivannan.sadhasivam, dmaengine, linux-kernel, brody.shi,
kevin.song, qixiang.zhong, tom.hu, richard.yang
On Sat, Jan 31, 2026 at 06:45:50PM +0800, Shi-Shenghui wrote:
> From: Shenghui Shi <brody.shi@m2semi.com>
>
> 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.
>
> This issue was reproduced and tested on:
> - Device: [20e0:2502] (rev 01)
> - Kernel: 6.8.0-90-generic
I think needn't these informaiton, fixes tag commit already know which
kernel have problem.
>
> Fixes: e63d79d1ff04 ("dmaengine: dw-edma: Add Synopsys DesignWare eDMA IP core driver")
>
> Signed-off-by: Shenghui Shi <brody.shi@m2semi.com>
> ---
> drivers/dma/dw-edma/dw-edma-core.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
> index 8e5f7defa6b6..2b2a59fec053 100644
> --- a/drivers/dma/dw-edma/dw-edma-core.c
> +++ b/drivers/dma/dw-edma/dw-edma-core.c
> @@ -844,11 +844,13 @@ 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;
> u32 ch_cnt;
> int irq;
> + bool is_msix = false;
needn't set false.
>
> ch_cnt = dw->wr_ch_cnt + dw->rd_ch_cnt;
>
> @@ -895,9 +897,13 @@ 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) {
I prefer declear is_msix here and use "is_msi" insteand is_msix
bool is_msi;
> get_cached_msi_msg(irq, &dw->irq[i].msi);
> + is_msix = msi_desc && msi_desc->pci.msi_attrib.is_msix;
> + if (!is_msix && i > 0)
needn't check i > 0
do nothing "dw->irq[0].msi.data = dw->irq[0].msi.data + 0"
Frank
> + dw->irq[i].msi.data = dw->irq[0].msi.data + i;
> + }
> }
>
> dw->nr_irqs = i;
> --
> 2.49.0.windows.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-31 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-31 10:45 [PATCH v3] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case Shi-Shenghui
2026-01-31 18:07 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®