Re: [v3,4/4] stmmac: s32: enable support for Multi-IRQ mode
From: Jan Petrous <jan.petrous@oss.nxp.com>
Date: 2026-01-27 13:08:14
Also in:
imx, linux-devicetree, lkml, netdev
On Sun, Jan 25, 2026 at 02:14:05PM -0800, Jakub Kicinski wrote:
This is an AI-generated review of your patch. The human sending this email has considered the AI review valid, or at least plausible. For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html --- stmmac: s32: enable support for Multi-IRQ mode This patch enables Multi-IRQ mode for the S32 DWMAC driver when both multi-queue and per-queue IRQs are configured. The driver now selects between Multi-IRQ and MAC IRQ modes based on device tree configuration.quoted
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c index 5a485ee98fa7..342091045714 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c[ ... ]quoted
@@ -149,6 +149,16 @@ static int s32_dwmac_probe(struct platform_device *pdev) plat->core_type = DWMAC_CORE_GMAC4; plat->pmt = 1; plat->flags |= STMMAC_FLAG_SPH_DISABLE; + + /* Check for multi-IRQ config. Assumption: symetrical rx/tx queues */ + if (plat->rx_queues_to_use > 1 && + (res.rx_irq[0] >= 0 || res.tx_irq[0] >= 0)) {^^^^ ^^^^ Should these checks be "> 0" instead of ">= 0"? stmmac_get_platform_resources() initializes the res structure with memset(0), then only writes positive IRQ values when per-queue IRQs are found in the device tree. If no "rx-queue-0" or "tx-queue-0" interrupt names are defined, rx_irq[0] and tx_irq[0] remain 0 from the memset.
The AI is wrong on this statesment. The loop reading IRQs from DT in stmmac_get_platform_resources() returns also negative value for missed queue IRQ line. And this is used as flag if multi-IRQ can be enabled or not. But I must agree that the comparition shall not include 0 as valid value for IRQ, so I will fix it in v4. Thanks. /Jan