OpenCloudOS-Kernel/drivers/pci/pcie
Kuppuswamy Sathyanarayanan 6d2c894415 PCI/ERR: Update error status after reset_link()
Commit bdb5ac8577 ("PCI/ERR: Handle fatal error recovery") uses
reset_link() to recover from fatal errors.  But during fatal error
recovery, if the initial value of error status is PCI_ERS_RESULT_DISCONNECT
or PCI_ERS_RESULT_NO_AER_DRIVER then even after successful recovery (using
reset_link()) pcie_do_recovery() will report the recovery result as
failure.  Update the status of error after reset_link().

You can reproduce this issue by triggering a SW DPC using "DPC Software
Trigger" bit in "DPC Control Register".  You should see recovery failed
dmesg log as below:

  pcieport 0000:00:16.0: DPC: containment event, status:0x1f27 source:0x0000
  pcieport 0000:00:16.0: DPC: software trigger detected
  pci 0000:04:00.0: AER: can't recover (no error_detected callback)
  pcieport 0000:00:16.0: AER: device recovery failed

Fixes: bdb5ac8577 ("PCI/ERR: Handle fatal error recovery")
Link: https://lore.kernel.org/r/a255fcb3a3fdebcd90f84e08b555f1786eb8eba2.1585000084.git.sathyanarayanan.kuppuswamy@linux.intel.com
[bhelgaas: split pci_channel_io_frozen simplification to separate patch]
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
2020-03-28 11:52:22 -05:00
..
Kconfig Merge branch 'pci/misc' 2019-11-28 08:54:32 -06:00
Makefile PCI/LINK: Add Kconfig option (default off) 2019-05-02 08:34:32 -05:00
aer.c PCI/AER: Initialize aer_fifo 2020-01-23 16:40:03 -06:00
aer_inject.c PCI: Fix typos and whitespace errors 2019-07-09 07:24:53 -05:00
aspm.c PCI/ASPM: Remove PCIEASPM_DEBUG Kconfig option and related code 2019-11-21 17:31:46 -06:00
bw_notification.c pci-v5.2-changes 2019-05-14 10:30:10 -07:00
dpc.c PCI/DPC: Add "pcie_ports=dpc-native" to allow DPC without AER control 2019-10-25 15:11:43 -05:00
err.c PCI/ERR: Update error status after reset_link() 2020-03-28 11:52:22 -05:00
pme.c PCI/PME: Replace dev_printk(KERN_DEBUG) with dev_info() 2019-05-09 16:27:29 -05:00
portdrv.h PCI/DPC: Add "pcie_ports=dpc-native" to allow DPC without AER control 2019-10-25 15:11:43 -05:00
portdrv_core.c PCI/DPC: Add "pcie_ports=dpc-native" to allow DPC without AER control 2019-10-25 15:11:43 -05:00
portdrv_pci.c PCI/DPC: Add "pcie_ports=dpc-native" to allow DPC without AER control 2019-10-25 15:11:43 -05:00
ptm.c PCI/PTM: Remove spurious "d" from granularity message 2019-11-21 07:52:32 -06:00