* [PATCH v6] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
@ 2026-02-09 9:36 Shi-Shenghui
2026-02-09 10:37 ` [PATCH v7] " Shi-Shenghui
0 siblings, 1 reply; 5+ messages in thread
From: Shi-Shenghui @ 2026-02-09 9:36 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.
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 | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
index 8e5f7defa6b6..dccc686b7a3e 100644
--- a/drivers/dma/dw-edma/dw-edma-core.c
+++ b/drivers/dma/dw-edma/dw-edma-core.c
@@ -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,15 @@ static int dw_edma_irq_request(struct dw_edma *dw,
&dw->irq[i]);
if (err)
goto err_irq_free;
+ msi_desc = irq_get_msi_desc(irq);
+ if (msi_desc) {
+ bool is_msi;
- if (irq_get_msi_desc(irq))
get_cached_msi_msg(irq, &dw->irq[i].msi);
+ is_msi = msi_desc && !msi_desc->pci.msi_attrib.is_msix;
+ if (is_msi)
+ dw->irq[i].msi.data = dw->irq[0].msi.data + i;
+ }
}
dw->nr_irqs = i;
--
2.49.0.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v7] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
2026-02-09 9:36 [PATCH v6] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case Shi-Shenghui
@ 2026-02-09 10:37 ` Shi-Shenghui
2026-02-09 16:45 ` Frank Li
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Shi-Shenghui @ 2026-02-09 10:37 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.
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 | 8 ++++++--
1 file changed, 6 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..22d906426d75 100644
--- a/drivers/dma/dw-edma/dw-edma-core.c
+++ b/drivers/dma/dw-edma/dw-edma-core.c
@@ -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;
--
2.49.0.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v7] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
2026-02-09 10:37 ` [PATCH v7] " Shi-Shenghui
@ 2026-02-09 16:45 ` Frank Li
2026-02-25 11:02 ` Vinod Koul
2026-02-25 11:21 ` Vinod Koul
2 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-02-09 16:45 UTC (permalink / raw)
To: Shi-Shenghui
Cc: vkoul, manivannan.sadhasivam, dmaengine, linux-kernel, brody.shi,
kevin.song, qixiang.zhong, tom.hu, richard.yang
On Mon, Feb 09, 2026 at 06:37:25PM +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.
>
> 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>
> drivers/dma/dw-edma/dw-edma-core.c | 8 ++++++--
> 1 file changed, 6 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..22d906426d75 100644
> --- a/drivers/dma/dw-edma/dw-edma-core.c
> +++ b/drivers/dma/dw-edma/dw-edma-core.c
> @@ -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;
> --
> 2.49.0.windows.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v7] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
2026-02-09 10:37 ` [PATCH v7] " Shi-Shenghui
2026-02-09 16:45 ` Frank Li
@ 2026-02-25 11:02 ` Vinod Koul
2026-02-25 11:21 ` Vinod Koul
2 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2026-02-25 11:02 UTC (permalink / raw)
To: Shi-Shenghui
Cc: Frank.Li, manivannan.sadhasivam, dmaengine, linux-kernel,
brody.shi, kevin.song, qixiang.zhong, tom.hu, richard.yang
On 09-02-26, 18:37, 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.
>
> Fixes: e63d79d1ff04 ("dmaengine: dw-edma: Add Synopsys DesignWare eDMA IP core driver")
>
> Signed-off-by: Shenghui Shi <brody.shi@m2semi.com>
No blank lines after Fixes tag please. I have fixed it while applying
--
~Vinod
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v7] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
2026-02-09 10:37 ` [PATCH v7] " Shi-Shenghui
2026-02-09 16:45 ` Frank Li
2026-02-25 11:02 ` Vinod Koul
@ 2026-02-25 11:21 ` Vinod Koul
2 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2026-02-25 11:21 UTC (permalink / raw)
To: Frank.Li, Shi-Shenghui
Cc: dmaengine, linux-kernel, brody.shi, kevin.song, qixiang.zhong,
tom.hu, richard.yang, Manivannan Sadhasivam
On Mon, 09 Feb 2026 18:37:25 +0800, Shi-Shenghui wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case
commit: 77b19d053ac2cce9e873007ad4b09f2323c93576
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-25 11:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 9:36 [PATCH v6] dmaengine: dw-edma: fix MSI data programming for multi-IRQ case Shi-Shenghui
2026-02-09 10:37 ` [PATCH v7] " Shi-Shenghui
2026-02-09 16:45 ` Frank Li
2026-02-25 11:02 ` Vinod Koul
2026-02-25 11:21 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox