]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI/MSI: Add TODO comment about legacy pcim_enable_device() side-effect
authorShawn Lin <shawn.lin@rock-chips.com>
Wed, 11 Feb 2026 08:24:59 +0000 (16:24 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 23 Feb 2026 15:01:20 +0000 (09:01 -0600)
Add a TODO comment in pci/msi/msi.c to document that the automatic IRQ
vector management activated by pcim_enable_device() is a dangerous and
confusing.

Suggested-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/1770798299-202288-4-git-send-email-shawn.lin@rock-chips.com
drivers/pci/msi/msi.c

index e2412175d7af20e53d20c643259712c82de3137a..81d24a270a795ce9edd9027aeb59f32bf6a3e2ce 100644 (file)
@@ -77,6 +77,16 @@ static void pcim_msi_release(void *pcidev)
 /*
  * Needs to be separate from pcim_release to prevent an ordering problem
  * vs. msi_device_data_release() in the MSI core code.
+ *
+ * TODO: Remove the legacy side-effect of pcim_enable_device() that
+ * activates automatic IRQ vector management. This design is dangerous
+ * and confusing because it switches normally un-managed functions
+ * into managed mode. Drivers should explicitly manage their IRQ vectors
+ * without this implicit behavior.
+ *
+ * The current implementation uses both pdev->is_managed and
+ * pdev->is_msi_managed flags, which adds unnecessary complexity.
+ * This should be simplified in a future kernel version.
  */
 static int pcim_setup_msi_release(struct pci_dev *dev)
 {