[PATCH net-next 1/2] net: stmmac: intel: Fix IRQ vector leak

Florian Bezdeka posted 2 patches 11 hours ago
[PATCH net-next 1/2] net: stmmac: intel: Fix IRQ vector leak
Posted by Florian Bezdeka 11 hours ago
The IRQ vectors allocated in stmmac_config_multi_msi() or
stmmac_config_single_msi() where never cleaned up.

Fixes: b42446b9b37b ("stmmac: intel: add support for multi-vector msi and msi-x")
Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index aad1be1ec4c11c3da8a1f56cdc200250b7f2d1d9..48e6d61064bd57afe90d3b83cbb3f2fe5351166a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -1327,6 +1327,7 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
 err_alloc_irq:
 	clk_disable_unprepare(plat->stmmac_clk);
 	clk_unregister_fixed_rate(plat->stmmac_clk);
+	pci_free_irq_vectors(pdev);
 	return ret;
 }
 
@@ -1346,6 +1347,7 @@ static void intel_eth_pci_remove(struct pci_dev *pdev)
 
 	clk_disable_unprepare(priv->plat->stmmac_clk);
 	clk_unregister_fixed_rate(priv->plat->stmmac_clk);
+	pci_free_irq_vectors(pdev);
 }
 
 #define PCI_DEVICE_ID_INTEL_QUARK		0x0937

-- 
2.53.0
Re: [PATCH net-next 1/2] net: stmmac: intel: Fix IRQ vector leak
Posted by Russell King (Oracle) 11 hours ago
Note that net-next is currently closed. Patches for net-next should
be sent RFC. Please see the netdev *whatever it is* documentation (I
can never remember the name of the renamed document nor it's URL).
It's somewhere on docs.kernel.org and is in Documentation/ somewhere.
I'm getting tired of having to do a google search every single time
I respond to someone about this.

On Tue, Feb 10, 2026 at 05:28:14PM +0100, Florian Bezdeka wrote:
> The IRQ vectors allocated in stmmac_config_multi_msi() or
> stmmac_config_single_msi() where never cleaned up.

Please refer to:

https://lore.kernel.org/netdev/27fec7d0ed633218a7787be3edce63c3038c63e2.camel@mailbox.org/
https://lore.kernel.org/netdev/7e024db2557a4d5822a0dd409ae678d10d815d9c.camel@mailbox.org/

and the associated discussion in that thread.

PCI is weird. If pcim_enable_device() is used, it switches all sorts of
other functions to managed mode. The missing cleanup here isn't
actually missing, it's buried in the depths of PCI code. So, this is
not a bug, and thus:

> 
> Fixes: b42446b9b37b ("stmmac: intel: add support for multi-vector msi and msi-x")

this is not a fix.

However, if you look at Philipp's replies, there is a desire to get
rid of this PCI behaviour, so your patch is useful - it just needs not
to be dressed up as a fix.

I am keen that we cut down on the duplication between drivers. Having
_four_ stmmac PCI drivers all using MSI but no sharing any code is
silly.

Please consider what you can do to improve the current situation with
these stmmac PCI drivers.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!