]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/ERR: Recognize disconnected devices in report_error_detected()
authorChristoph Hellwig <hch@lst.de>
Wed, 1 Jun 2022 07:40:24 +0000 (09:40 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 8 Jun 2022 20:08:40 +0000 (15:08 -0500)
commit1845dcc51e3604d15411ef573a5d5895c00952a7
tree3f1206d3a883684757d3265db6e288fad3c2da22
parentf040cca4b0da0180bf9de9141ef5c95f60f85182
PCI/ERR: Recognize disconnected devices in report_error_detected()

When a device is already unplugged by pciehp by the time the AER handler is
invoked, the PCIe device will already be in the pci_channel_io_perm_failure
state.  In that case simply return PCI_ERS_RESULT_DISCONNECT instead of
trying to do a state transition that will fail.

Also untangle the state transition failure from the lack of methods to
improve the debugging output in case it happens again.

Link: https://lore.kernel.org/r/20220601074024.3481035-1-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
drivers/pci/pcie/err.c