summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorPhilipp Stanner <pstanner@redhat.com>2024-06-13 13:50:23 +0200
committerBjorn Helgaas <bhelgaas@google.com>2024-07-11 23:20:01 +0200
commit25216afc9db53d85dc648aba8fb7f6d31f2c8731 (patch)
treeea85ef3f53dd087c958bd1ad80ce95cd9d8cae1d /drivers/pci/pci.h
parentPCI: Give pcim_set_mwi() its own devres cleanup callback (diff)
downloadlinux-25216afc9db53d85dc648aba8fb7f6d31f2c8731.tar.xz
linux-25216afc9db53d85dc648aba8fb7f6d31f2c8731.zip
PCI: Add managed pcim_intx()
pci_intx() is a "hybrid" function, i.e., it is managed if pcim_enable_device() has been called, but unmanaged otherwise. Add pcim_intx(), which is always managed, and implement pci_intx() using it. Remove the now-unused struct pci_devres.orig_intx and .restore_intx and find_pci_dr(). Link: https://lore.kernel.org/r/20240613115032.29098-11-pstanner@redhat.com Signed-off-by: Philipp Stanner <pstanner@redhat.com> [kwilczynski: squashed in https://lore.kernel.org/r/426645d40776198e0fcc942f4a6cac4433c7a9aa.camel@redhat.com to fix problem reported and tested by Ashish Kalra <Ashish.Kalra@amd.com>: https://lore.kernel.org/r/20240708214656.4721-1-Ashish.Kalra@amd.com https://lore.kernel.org/r/8c4634e9-4f02-4c54-9c89-d75e2f4bf026@amd.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.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 9a12f6774431..21cb44176350 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -816,16 +816,17 @@ static inline pci_power_t mid_pci_get_power_state(struct pci_dev *pdev)
* there's no need to track it separately. pci_devres is initialized
* when a device is enabled using managed PCI device enable interface.
*
- * TODO: Struct pci_devres and find_pci_dr() only need to be here because
- * they're used in pci.c. Port or move these functions to devres.c and
- * then remove them from here.
+ * TODO: Struct pci_devres only needs to be here because they're used in pci.c.
+ * Port or move these functions to devres.c and then remove them from here.
*/
struct pci_devres {
- unsigned int orig_intx:1;
- unsigned int restore_intx:1;
+ /*
+ * TODO:
+ * This struct is now surplus. Remove it by refactoring pci/devres.c
+ */
};
-struct pci_devres *find_pci_dr(struct pci_dev *pdev);
+int pcim_intx(struct pci_dev *dev, int enable);
int pcim_request_region(struct pci_dev *pdev, int bar, const char *name);
int pcim_request_region_exclusive(struct pci_dev *pdev, int bar,