summaryrefslogtreecommitdiff
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-10-25 17:09:24 -0500
committerBjorn Helgaas <bhelgaas@google.com>2017-10-25 17:09:24 -0500
commit832c418a1530afba54fd96a2cca0912ec9036080 (patch)
treeb361105c1dd5cff8ddcc670322c41b2c45889cdb /drivers/pci/pci.c
parent16b6c8bb687cc3bec914de09061fcb8411951fda (diff)
PCI: Document reset method return values
The pci_reset_function() path may try several different reset methods: device-specific resets, PCIe Function Level Resets, PCI Advanced Features Function Level Reset, etc. Add a comment about what the return values from these methods mean. If one of the methods fails, in some cases we want to continue and try the next one in the list, but sometimes we want to stop trying. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f0d68066c726..3ff0c3c18276 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4170,6 +4170,14 @@ int __pci_reset_function_locked(struct pci_dev *dev)
might_sleep();
+ /*
+ * A reset method returns -ENOTTY if it doesn't support this device
+ * and we should try the next method.
+ *
+ * If it returns 0 (success), we're finished. If it returns any
+ * other error, we're also finished: this indicates that further
+ * reset mechanisms might be broken on the device.
+ */
rc = pci_dev_specific_reset(dev, 0);
if (rc != -ENOTTY)
return rc;