mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present
@ 2026-11-05  2:32 muhammad.nazim.amirul.nazle.asmade
  2026-11-11  1:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: muhammad.nazim.amirul.nazle.asmade @ 2026-11-05  2:32 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Maxime Chevallier, Dinh Nguyen, Maxime Coquelin,
	Alexandre Torgue, netdev, linux-stm32, linux-arm-kernel,
	linux-kernel

From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>

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.

Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
---
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/20240105070925.2948871-1-leong.ching.swee@intel.com/
[2] https://lore.kernel.org/all/2df9fe3e-7971-4aa2-89a9-0e085b3b00d7@linaro.org/
[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(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index 6d4bc1fe8f75..2ca45b3dfa90 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -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);
 }
 
-- 
2.43.7


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present
  2026-11-05  2:32 [PATCH net-next] net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present muhammad.nazim.amirul.nazle.asmade
@ 2026-11-11  1:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-11  1:30 UTC (permalink / raw)
  To: Nazle, Asmade, Muhammad Nazim Amirul
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, maxime.chevallier,
	dinguyen, mcoquelin.stm32, alexandre.torgue, netdev, linux-stm32,
	linux-arm-kernel, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed,  4 Nov 2026 18:32:45 -0800 you wrote:
> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
> 
> 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.
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-11  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-05  2:32 [PATCH net-next] net: stmmac: dwmac-socfpga: Enable multi-IRQ when per-queue IRQs present muhammad.nazim.amirul.nazle.asmade
2026-11-11  1:30 ` patchwork-bot+netdevbpf

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®