diff options
author | Keith Busch <keith.busch@intel.com> | 2018-09-20 18:27:16 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-10-02 23:04:40 +0200 |
commit | a6bd101b8f84f9b98768e9ab1e418c239e2e669f (patch) | |
tree | 916bea7101fb1de3444e351c583205653cfc464a /drivers/pci/pcie/err.c | |
parent | PCI/ERR: Always report current recovery status for udev (diff) | |
download | linux-a6bd101b8f84f9b98768e9ab1e418c239e2e669f.tar.xz linux-a6bd101b8f84f9b98768e9ab1e418c239e2e669f.zip |
PCI: Unify device inaccessible
Bring surprise removals and permanent failures together so we no longer
need separate flags. The implementation enforces that error handling will
not be able to override a surprise removal's permanent channel failure.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Sinan Kaya <okaya@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/pci/pcie/err.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 31e8a4314384..4da2a62b4f77 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -52,9 +52,8 @@ static int report_error_detected(struct pci_dev *dev, const struct pci_error_handlers *err_handler; device_lock(&dev->dev); - dev->error_state = state; - - if (!dev->driver || + if (!pci_dev_set_io_state(dev, state) || + !dev->driver || !dev->driver->err_handler || !dev->driver->err_handler->error_detected) { /* @@ -130,9 +129,8 @@ static int report_resume(struct pci_dev *dev, void *data) const struct pci_error_handlers *err_handler; device_lock(&dev->dev); - dev->error_state = pci_channel_io_normal; - - if (!dev->driver || + if (!pci_dev_set_io_state(dev, pci_channel_io_normal) || + !dev->driver || !dev->driver->err_handler || !dev->driver->err_handler->resume) goto out; |