linux-stable/drivers/pci
Kuppuswamy Sathyanarayanan 1a2a0d5b06 PCI/EDR: Clear Device Status after EDR error recovery
[ Upstream commit c441b1e03d ]

During EDR recovery, the OS must clear error status of the port that
triggered DPC even if firmware retains control of DPC and AER (see the
implementation note in the PCI Firmware spec r3.3, sec 4.6.12).

Prior to 068c29a248 ("PCI/ERR: Clear PCIe Device Status errors only if
OS owns AER"), the port Device Status was cleared in this path:

  edr_handle_event
    dpc_process_error(dev)                 # "dev" triggered DPC
    pcie_do_recovery(dev, dpc_reset_link)
      dpc_reset_link                       # exit DPC
      pcie_clear_device_status(dev)        # clear Device Status

After 068c29a248, pcie_do_recovery() no longer clears Device Status when
firmware controls AER, so the error bit remains set even after recovery.

Per the "Downstream Port Containment configuration control" bit in the
returned _OSC Control Field (sec 4.5.1), the OS is allowed to clear error
status until it evaluates _OST, so clear Device Status in
edr_handle_event() if the error recovery was successful.

[bhelgaas: commit log]
Fixes: 068c29a248 ("PCI/ERR: Clear PCIe Device Status errors only if OS owns AER")
Link: https://lore.kernel.org/r/20230315235449.1279209-1-sathyanarayanan.kuppuswamy@linux.intel.com
Reported-by: Tsaur Erwin <erwin.tsaur@intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:00:32 +09:00
..
controller PCI: imx6: Install the fault handler only on compatible match 2023-05-11 23:00:32 +09:00
endpoint PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled 2022-12-31 13:14:22 +01:00
hotplug PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock 2023-05-11 23:00:15 +09:00
pcie PCI/EDR: Clear Device Status after EDR error recovery 2023-05-11 23:00:32 +09:00
switch PCI: switchtec: Return -EFAULT for copy_to_user() errors 2023-03-10 09:39:37 +01:00
access.c
ats.c
bus.c PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-22 13:31:24 +01:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Enlarge virtfn sysfs name buffer 2023-03-10 09:39:37 +01:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-12-31 13:14:24 +01:00
Kconfig
Makefile
mmap.c
msi.c
of.c
p2pdma.c memremap: remove support for external pgmap refcounts 2022-08-17 14:23:43 +02:00
pci-acpi.c
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c PCI: Unify delay handling for reset and resume 2023-03-22 13:31:37 +01:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Fix double free in error path 2023-01-12 11:58:58 +01:00
pci.c PCI/ASPM: Remove pcie_aspm_pm_state_change() 2023-05-01 08:23:23 +09:00
pci.h PCI/ASPM: Remove pcie_aspm_pm_state_change() 2023-05-01 08:23:23 +09:00
probe.c
proc.c
quirks.c PCI: Add ACS quirk for Wangxun NICs 2023-03-11 13:57:38 +01:00
remove.c
rom.c
search.c
setup-bus.c PCI: Take other bus devices into account when distributing resources 2023-03-11 13:57:37 +01:00
setup-irq.c
setup-res.c PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge 2022-10-26 12:34:24 +02:00
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c