[PATCH RFC 4/4] stmmac: s32: enable multi irqs mode

Jan Petrous via B4 Relay posted 4 patches 1 day, 9 hours ago
[PATCH RFC 4/4] stmmac: s32: enable multi irqs mode
Posted by Jan Petrous via B4 Relay 1 day, 9 hours ago
From: "Jan Petrous (OSS)" <jan.petrous@oss.nxp.com>

Signalize support for multi irq mode.

From now, if yoused old DT node, without channel IRQs set,
the driver fails to init with the following error:

[4.925420] s32-dwmac 4033c000.ethernet eth0: stmmac_request_irq_multi_msi: alloc rx-0  MSI -6 (error: -22)

Signed-off-by: Jan Petrous (OSS) <jan.petrous@oss.nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
index 5a485ee98fa7..284e2067a00b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
@@ -2,7 +2,7 @@
 /*
  * NXP S32G/R GMAC glue layer
  *
- * Copyright 2019-2024 NXP
+ * Copyright 2019-2025 NXP
  *
  */
 
@@ -149,6 +149,7 @@ static int s32_dwmac_probe(struct platform_device *pdev)
 	plat->core_type = DWMAC_CORE_GMAC4;
 	plat->pmt = 1;
 	plat->flags |= STMMAC_FLAG_SPH_DISABLE;
+	plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
 	plat->rx_fifo_size = 20480;
 	plat->tx_fifo_size = 20480;
 

-- 
2.47.0
Re: [PATCH RFC 4/4] stmmac: s32: enable multi irqs mode
Posted by Andrew Lunn 1 day, 9 hours ago
On Sun, Dec 14, 2025 at 11:15:40PM +0100, Jan Petrous via B4 Relay wrote:
> From: "Jan Petrous (OSS)" <jan.petrous@oss.nxp.com>
> 
> Signalize support for multi irq mode.
> 
> >From now, if yoused old DT node, without channel IRQs set,
> the driver fails to init with the following error:
> 
> [4.925420] s32-dwmac 4033c000.ethernet eth0: stmmac_request_irq_multi_msi: alloc rx-0  MSI -6 (error: -22)

Sorry, but that is not acceptable. You cannot break old DT blobs.

Please reverse the logic. If you find all the needed properties in DT
enable STMMAC_FLAG_MULTI_MSI_EN. If none of the properties are there,
continue using one interrupt, and if only some of the needed
properties are there but some are missing, then you can error out with
EINVAL, because the DT blob is invalid.

	Andrew
Re: [PATCH RFC 4/4] stmmac: s32: enable multi irqs mode
Posted by Jan Petrous 17 hours ago
On Sun, Dec 14, 2025 at 11:37:51PM +0100, Andrew Lunn wrote:
> On Sun, Dec 14, 2025 at 11:15:40PM +0100, Jan Petrous via B4 Relay wrote:
> > From: "Jan Petrous (OSS)" <jan.petrous@oss.nxp.com>
> > 
> > Signalize support for multi irq mode.
> > 
> > >From now, if yoused old DT node, without channel IRQs set,
> > the driver fails to init with the following error:
> > 
> > [4.925420] s32-dwmac 4033c000.ethernet eth0: stmmac_request_irq_multi_msi: alloc rx-0  MSI -6 (error: -22)
> 
> Sorry, but that is not acceptable. You cannot break old DT blobs.
> 
> Please reverse the logic. If you find all the needed properties in DT
> enable STMMAC_FLAG_MULTI_MSI_EN. If none of the properties are there,
> continue using one interrupt, and if only some of the needed
> properties are there but some are missing, then you can error out with
> EINVAL, because the DT blob is invalid.
> 

Yeh, that was the main reason of marking it as RFC, I was not sure
if I can break old DT blobs or not.

Thanks for answer. I will change the procedure to stay
backward compatible.

/Jan