public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Documentation: PCI: Clarify pci_free_irq_vectors() usage for managed devices
@ 2026-01-26  2:57 Shawn Lin
  2026-02-06 22:33 ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn Lin @ 2026-01-26  2:57 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-doc, Shawn Lin

Update the msi-howto.rst documentation to clarify that drivers using the
resource-managed function pcim_enable_device() must not call pci_free_irq_vectors().
This is because such devices have automatic IRQ vector management via pcim_msi_release(),
which is registered by pci_setup_msi_context() when pdev->is_managed is true.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 Documentation/PCI/msi-howto.rst | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/PCI/msi-howto.rst b/Documentation/PCI/msi-howto.rst
index 667ebe2..dc85f1e 100644
--- a/Documentation/PCI/msi-howto.rst
+++ b/Documentation/PCI/msi-howto.rst
@@ -113,8 +113,11 @@ vectors, use the following function::
 
   int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
 
-Any allocated resources should be freed before removing the device using
-the following function::
+If the driver enables the device using the resource-managed function
+pcim_enable_device(), the driver shouldn't call pci_free_irq_vectors()
+because the IRQ vectors are automatically managed. Otherwise, the driver
+should free any allocated IRQ vectors before removing the device using the
+following function::
 
   void pci_free_irq_vectors(struct pci_dev *dev);
 
-- 
2.7.4


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

end of thread, other threads:[~2026-02-11  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26  2:57 [PATCH] Documentation: PCI: Clarify pci_free_irq_vectors() usage for managed devices Shawn Lin
2026-02-06 22:33 ` Bjorn Helgaas
2026-02-09  8:05   ` Philipp Stanner
2026-02-11  7:27     ` Shawn Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox