summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2026-02-11 11:24:59 +0300
committerBjorn Helgaas <bhelgaas@google.com>2026-02-23 18:01:20 +0300
commit874b07eb0875729b9a47441e03b125d9fa735645 (patch)
tree87b7728d8a9042dd6aedba2c8f5184c6b6a814b0
parent03e4905402ae60aa1d7a65770076bb2c1df8f6ac (diff)
downloadlinux-874b07eb0875729b9a47441e03b125d9fa735645.tar.xz
PCI/MSI: Add TODO comment about legacy pcim_enable_device() side-effect
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
-rw-r--r--drivers/pci/msi/msi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index e2412175d7af..81d24a270a79 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -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)
{