summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 59e0949fb079..d94445f5f882 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3883,6 +3883,17 @@ void pci_release_region(struct pci_dev *pdev, int bar)
release_mem_region(pci_resource_start(pdev, bar),
pci_resource_len(pdev, bar));
+ /*
+ * This devres utility makes this function sometimes managed
+ * (when pcim_enable_device() has been called before).
+ *
+ * This is bad because it conflicts with the pcim_ functions being
+ * exclusively responsible for managed PCI. Its "sometimes yes,
+ * sometimes no" nature can cause bugs.
+ *
+ * TODO: Remove this once all users that use pcim_enable_device() PLUS
+ * a region request function have been ported to using pcim_ functions.
+ */
dr = find_pci_dr(pdev);
if (dr)
dr->region_mask &= ~(1 << bar);
@@ -3927,6 +3938,17 @@ static int __pci_request_region(struct pci_dev *pdev, int bar,
goto err_out;
}
+ /*
+ * This devres utility makes this function sometimes managed
+ * (when pcim_enable_device() has been called before).
+ *
+ * This is bad because it conflicts with the pcim_ functions being
+ * exclusively responsible for managed pci. Its "sometimes yes,
+ * sometimes no" nature can cause bugs.
+ *
+ * TODO: Remove this once all users that use pcim_enable_device() PLUS
+ * a region request function have been ported to using pcim_ functions.
+ */
dr = find_pci_dr(pdev);
if (dr)
dr->region_mask |= 1 << bar;