TencentOS-kernel/drivers/pci
Kuppuswamy Sathyanarayanan 7bb9e9b720 PCI/ERR: Update error status after reset_link()
commit 6d2c89441571ea534d6240f7724f518936c44f8d upstream.
Backport summary: for 5.4 kernel ICX PCIe Gen4 support.

Commit bdb5ac85777d ("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: bdb5ac85777d ("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>

(cherry picked from commit 6d2c89441571ea534d6240f7724f518936c44f8d)
Signed-off-by: Ethan Zhao <haifeng.zhao@intel.com>

Conflicts:
	drivers/pci/pcie/err.c
2021-04-25 14:31:13 +08:00
..
controller PCI: mediatek: Add missing of_node_put() to fix reference leak 2021-04-12 12:53:03 +08:00
endpoint PCI: endpoint: Fix for concurrent memory allocation in OB address region 2021-03-16 16:26:03 +08:00
hotplug PCI: rpadlpar: Fix potential drc_name corruption in store functions 2021-04-12 12:53:20 +08:00
pcie PCI/ERR: Update error status after reset_link() 2021-04-25 14:31:13 +08:00
switch PCI/switchtec: Fix init_completion race condition with poll_wait() 2021-03-16 16:25:57 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
access.c Intel:PCI/AER: Save AER Capability for suspend/resume 2021-04-25 14:31:13 +08:00
ats.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bus.c PCI: Add device even if driver attach failed 2021-03-16 16:33:58 +08:00
ecam.c drivers/pci: Add ecam quirk for Ampere Altra SOC. 2021-03-16 16:43:59 +08:00
host-bridge.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iov.c PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY 2021-03-16 16:39:00 +08:00
irq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mmap.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
msi.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
of.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
p2pdma.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci-acpi.c PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() 2021-03-16 16:43:23 +08:00
pci-bridge-emul.c PCI: pci-bridge-emul: Fix PCIe bit conflicts 2021-03-16 16:30:02 +08:00
pci-bridge-emul.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci-driver.c PCI/PM: Add missing link delays required by the PCIe spec 2021-03-16 16:26:50 +08:00
pci-label.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci-mid.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci-pf-stub.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci-stub.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci-sysfs.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci.c Intel:PCI/AER: Save AER Capability for suspend/resume 2021-04-25 14:31:13 +08:00
pci.h Intel:PCI/AER: Save AER Capability for suspend/resume 2021-04-25 14:31:13 +08:00
probe.c PCI: Fix pci_register_host_bridge() device_register() error handling 2021-03-16 16:30:16 +08:00
proc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
quirks.c PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller 2021-04-12 12:52:55 +08:00
remove.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rom.c PCI: Use ioremap(), not phys_to_virt() for platform ROM 2021-03-16 16:37:08 +08:00
search.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
setup-bus.c PCI: Avoid double hpmemsize MMIO window assignment 2021-03-16 16:36:39 +08:00
setup-irq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
setup-res.c PCI: Decline to resize resources if boot config must be preserved 2021-04-12 12:52:10 +08:00
slot.c PCI: Fix pci_slot_release() NULL pointer dereference 2021-03-16 16:43:46 +08:00
syscall.c PCI: Align checking of syscall user config accessors 2021-04-12 12:52:30 +08:00
vc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vpd.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xen-pcifront.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00