summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorPhilipp Stanner <pstanner@redhat.com>2024-06-13 13:50:18 +0200
committerKrzysztof Wilczyński <kwilczynski@kernel.org>2024-07-10 06:19:56 +0200
commitd47bde708086c77b1ceeb7643e600089f63dd03b (patch)
treede1b84aa050972d9b757bd9c14a60ad2fb3c952f /drivers/pci/pci.h
parentPCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all() (diff)
downloadlinux-d47bde708086c77b1ceeb7643e600089f63dd03b.tar.xz
linux-d47bde708086c77b1ceeb7643e600089f63dd03b.zip
PCI: Add managed pcim_request_region()
These existing functions: pci_request_region() pci_request_selected_regions() pci_request_selected_regions_exclusive() are "hybrid" functions built on __pci_request_region() and are managed if pcim_enable_device() has been called, but unmanaged otherwise. Add these new functions: pcim_request_region() pcim_request_region_exclusive() These are *always* managed and use the new pcim_addr_devres tracking infrastructure instead of find_pci_dr() and struct pci_devres.region_mask. Implement the hybrid functions using the new "pure" functions and remove struct pci_devres.region_mask, which is no longer needed. Link: https://lore.kernel.org/r/20240613115032.29098-6-pstanner@redhat.com Signed-off-by: Philipp Stanner <pstanner@redhat.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index c09487f5550c..37894852c2a0 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -826,16 +826,15 @@ struct pci_devres {
unsigned int orig_intx:1;
unsigned int restore_intx:1;
unsigned int mwi:1;
-
- /*
- * TODO: remove the region_mask once everyone calling
- * pcim_enable_device() + pci_*region*() is ported to pcim_ functions.
- */
- u32 region_mask;
};
struct pci_devres *find_pci_dr(struct pci_dev *pdev);
+int pcim_request_region(struct pci_dev *pdev, int bar, const char *name);
+int pcim_request_region_exclusive(struct pci_dev *pdev, int bar,
+ const char *name);
+void pcim_release_region(struct pci_dev *pdev, int bar);
+
/*
* Config Address for PCI Configuration Mechanism #1
*