Skip to contentSkip to conversation

net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present

PATCH Applied [email protected] 2 participants 2 messages Nov 5 – Nov 11

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present

From: Nazim Amirul <[email protected]>

Agilex5 and other SoCFPGA platforms can wire per-DMA-channel TX/RX completion interrupts through the GIC as named platform IRQs. The common stmmac platform code already parses "tx-queue-N" / "rx-queue-N".

Follow the same approach as dwmac-s32: if all configured TX and RX queue IRQs are present, set STMMAC_FLAG_MULTI_MSI_EN so the existing multi-IRQ request path and INTM=1 programming are used. Otherwise keep the single macirq path.

---
Background:

Per DMA channel interrupt support was first merged in 2024 as part of Leong Ching Swee's series [1], and then reverted in commit e9ee910218ff because the devicetree binding had not been reviewed yet [2].

Since then, the remaining pieces have landed upstream separately: the binding allows the "tx-queue-N"/"rx-queue-N" interrupts, the platform code parses them, and the DWMAC4 and XGMAC DMA code programs INTM for multi-MSI. The Agilex5 DTS also describes the per-queue interrupts.

The only missing part is enabling STMMAC_FLAG_MULTI_MSI_EN in dwmac-socfpga, which this patch adds. It was posted before [3], but was deferred because net-next was closed for the merge window.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/20260817074221.27459-2-muhammad.nazim.amirul.nazle.asmade@altera.com/

 .../ethernet/stmicro/stmmac/dwmac-socfpga.c   | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +31 -0
index 6d4bc1fe8f75..2ca45b3dfa90 100644
@@ -596,6 +596,35 @@ static void socfpga_agilex5_setup_plat_dat(struct socfpga_dwmac *dwmac)
 	plat_dat->crosststamp = smtg_crosststamp;
 }
 
+static void socfpga_dwmac_setup_multi_irq(struct device *dev,
+					  struct plat_stmmacenet_data *plat,
+					  struct stmmac_resources *res)
+{
+	int i;
+
+	for (i = 0; i < plat->rx_queues_to_use; i++) {
+		if (res->rx_irq[i] <= 0) {
+			dev_dbg(dev, "Missing RX queue %d interrupt\n", i);
+			goto mac_irq_mode;
+		}
+	}
+
+	for (i = 0; i < plat->tx_queues_to_use; i++) {
+		if (res->tx_irq[i] <= 0) {
+			dev_dbg(dev, "Missing TX queue %d interrupt\n", i);
+			goto mac_irq_mode;
+		}
+	}
+
+	plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
+	dev_info(dev, "Multi-IRQ mode (per queue IRQs) selected\n");
+	return;
+
+mac_irq_mode:
+	plat->flags &= ~STMMAC_FLAG_MULTI_MSI_EN;
+	dev_dbg(dev, "MAC IRQ mode selected\n");
+}
+
 static int socfpga_dwmac_probe(struct platform_device *pdev)
 {
 	struct plat_stmmacenet_data *plat_dat;
@@ -655,6 +684,8 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
 
 	ops->setup_plat_dat(dwmac);
 
+	socfpga_dwmac_setup_multi_irq(dev, plat_dat, &stmmac_res);
+
 	return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
 }
 
Signature · 1 line
2.43.7
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Wed, 4 Nov 2026 18:32:45 -0800 you wrote:

From: Nazim Amirul <[email protected]>

Agilex5 and other SoCFPGA platforms can wire per-DMA-channel TX/RX completion interrupts through the GIC as named platform IRQs. The common stmmac platform code already parses "tx-queue-N" / "rx-queue-N".

Quoted 6 lines

Follow the same approach as dwmac-s32: if all configured TX and RX queue IRQs are present, set STMMAC_FLAG_MULTI_MSI_EN so the existing multi-IRQ request path and INTM=1 programming are used. Otherwise keep the single macirq path.

[...]

Here is the summary with links:
- [net-next] net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present

    https://git.kernel.org/netdev/net-next/c/79ee9e676872

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html