linux-stable/drivers/pci/pcie
Kuppuswamy Sathyanarayanan 7cfae90e5c 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:11:22 +09:00
..
aer.c PCI/AER: Add optional logging callback for correctable error 2022-12-03 13:40:56 -08:00
aer_inject.c PCI/AER: Update aer-inject URL 2022-03-02 11:26:17 -06:00
aspm.c Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming" 2023-02-10 15:30:24 -06:00
dpc.c PCI/DPC: Await readiness of secondary bus after reset 2023-03-10 09:29:54 +01:00
edr.c PCI/EDR: Clear Device Status after EDR error recovery 2023-05-11 23:11:22 +09:00
err.c PCI/ERR: Recognize disconnected devices in report_error_detected() 2022-06-08 15:08:40 -05:00
Kconfig PCI: pciehp: Enable by default if USB4 enabled 2022-11-15 09:25:21 -06:00
Makefile PCI/portdrv: Squash into portdrv.c 2022-10-24 14:57:30 -05:00
pme.c PCI/PME: Use PCI_POSSIBLE_ERROR() to check config reads 2021-11-18 14:13:18 -06:00
portdrv.c PCI/portdrv: Prevent LS7A Bus Master clearing on shutdown 2023-03-11 13:50:41 +01:00
portdrv.h PCI/portdrv: Move private things to portdrv.c 2022-10-24 14:57:30 -05:00
ptm.c PCI/PTM: Reorder functions in logical order 2022-09-12 15:29:52 -05:00
rcec.c