diff options
author | Amey Narkhede <ameynarkhede03@gmail.com> | 2021-08-17 23:34:54 +0530 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-08-17 17:44:34 -0500 |
commit | e20afa06244eb5d7fa850f9fe2a78ae17ba96f81 (patch) | |
tree | 59696d3cb3c85dfb967e401ebc3e538a576256c3 /drivers/pci/pci.h | |
parent | 56f107d7813f116484019617043393a7753ffcbf (diff) | |
download | linux-e20afa06244eb5d7fa850f9fe2a78ae17ba96f81.tar.gz linux-e20afa06244eb5d7fa850f9fe2a78ae17ba96f81.tar.bz2 linux-e20afa06244eb5d7fa850f9fe2a78ae17ba96f81.zip |
PCI: Add array to track reset method ordering
Add reset_methods[] in struct pci_dev to keep track of reset mechanisms
supported by the device and their ordering.
Refactor probing and reset functions to take advantage of calling
convention of reset functions.
Co-developed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/r/20210817180500.1253-4-ameynarkhede03@gmail.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 93dcdd431072..ebeacb3dbe1e 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -33,7 +33,8 @@ enum pci_mmap_api { int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vmai, enum pci_mmap_api mmap_api); -int pci_probe_reset_function(struct pci_dev *dev); +bool pci_reset_supported(struct pci_dev *dev); +void pci_init_reset_methods(struct pci_dev *dev); int pci_bridge_secondary_bus_reset(struct pci_dev *dev); int pci_bus_error_reset(struct pci_dev *dev); @@ -610,6 +611,11 @@ struct pci_dev_reset_methods { int (*reset)(struct pci_dev *dev, int probe); }; +struct pci_reset_fn_method { + int (*reset_fn)(struct pci_dev *pdev, int probe); + char *name; +}; + #ifdef CONFIG_PCI_QUIRKS int pci_dev_specific_reset(struct pci_dev *dev, int probe); #else |