[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aTalXy_85pvLraIy@shell.armlinux.org.uk>
Date: Mon, 8 Dec 2025 10:15:59 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: phasta@...nel.org
Cc: Bjorn Helgaas <helgaas@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Yao Zi <ziyao@...root.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Frank <Frank.Sae@...or-comm.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Choong Yong Liang <yong.liang.choong@...ux.intel.com>,
Chen-Yu Tsai <wens@...e.org>, Jisheng Zhang <jszhang@...nel.org>,
Furong Xu <0x1207@...il.com>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, Mingcong Bai <jeffbai@...c.io>,
Kexy Biscuit <kexybiscuit@...c.io>, Runhua He <hua@...c.io>,
Xi Ruoyao <xry111@...111.site>
Subject: Re: [PATCH net-next v3 2/3] net: stmmac: Add glue driver for
Motorcomm YT6801 ethernet controller
On Mon, Dec 08, 2025 at 10:54:36AM +0100, Philipp Stanner wrote:
> The bad news is that it's not super trivial to remove. I looked into it
> about two times and decided I can't invest that time currently. You
> need to go over all drivers again to see who uses pcim_enable_device(),
> then add free_irq_vecs() for them all and so on…
So that I can confirm, you're saying that all drivers that call
pci_alloc_irq_vectors() should call pci_free_irq_vectors() in their
->remove() method and not rely on the devres behaviour that
pcim_enable_device() will permit.
In terms of whether it's safe to call this twice, pci_free_irq_vectors()
calls pci_disable_msix() and pci_disable_msi().
pci_disable_msix() checks:
if (!pci_msi_enabled() || !dev || !dev->msix_enabled)
return;
which will set dev->msix_enabled to 0 via pci_msix_shutdown().
pci_disable_msi() does a similar check:
if (!pci_msi_enabled() || !dev || !dev->msi_enabled)
return;
and similarly pci_msi_shutdown() sets dev->msi_enabled to 0.
So my conclusion is it's safe to call pci_free_irq_vectors() twice for
the same device.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists