OpenCloudOS-Kernel/drivers/pci/pcie
Kuppuswamy Sathyanarayanan ac1c8e35a3 PCI/DPC: Add Error Disconnect Recover (EDR) support
Error Disconnect Recover (EDR) is a feature that allows ACPI firmware to
notify OSPM that a device has been disconnected due to an error condition
(ACPI v6.3, sec 5.6.6).  OSPM advertises its support for EDR on PCI devices
via _OSC (see [1], sec 4.5.1, table 4-4).  The OSPM EDR notify handler
should invalidate software state associated with disconnected devices and
may attempt to recover them.  OSPM communicates the status of recovery to
the firmware via _OST (sec 6.3.5.2).

For PCIe, firmware may use Downstream Port Containment (DPC) to support
EDR.  Per [1], sec 4.5.1, table 4-6, even if firmware has retained control
of DPC, OSPM may read/write DPC control and status registers during the EDR
notification processing window, i.e., from the time it receives an EDR
notification until it clears the DPC Trigger Status.

Note that per [1], sec 4.5.1 and 4.5.2.4,

  1. If the OS supports EDR, it should advertise that to firmware by
     setting OSC_PCI_EDR_SUPPORT in _OSC Support.

  2. If the OS sets OSC_PCI_EXPRESS_DPC_CONTROL in _OSC Control to request
     control of the DPC capability, it must also set OSC_PCI_EDR_SUPPORT in
     _OSC Support.

Add an EDR notify handler to attempt recovery.

[1] Downstream Port Containment Related Enhancements ECN, Jan 28, 2019,
    affecting PCI Firmware Specification, Rev. 3.2
    https://members.pcisig.com/wg/PCI-SIG/document/12888

[bhelgaas: squash add/enable patches into one]
Link: https://lore.kernel.org/r/90f91fe6d25c13f9d2255d2ce97ca15be307e1bb.1585000084.git.sathyanarayanan.kuppuswamy@linux.intel.com
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
2020-03-28 13:19:04 -05:00
..
Kconfig PCI/DPC: Add Error Disconnect Recover (EDR) support 2020-03-28 13:19:04 -05:00
Makefile PCI/DPC: Add Error Disconnect Recover (EDR) support 2020-03-28 13:19:04 -05:00
aer.c PCI/AER: Add pci_aer_raw_clear_status() to unconditionally clear Error Status 2020-03-28 13:19:02 -05: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: Expose dpc_process_error(), dpc_reset_link() for use by EDR 2020-03-28 13:19:03 -05:00
edr.c PCI/DPC: Add Error Disconnect Recover (EDR) support 2020-03-28 13:19:04 -05:00
err.c PCI/ERR: Return status of pcie_do_recovery() 2020-03-28 13:19:01 -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/ERR: Remove service dependency in pcie_do_recovery() 2020-03-28 13:18:54 -05:00
portdrv_core.c PCI/ERR: Remove service dependency in pcie_do_recovery() 2020-03-28 13:18:54 -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