android_kernel_samsung_sm8650/drivers/pci/pcie
Ilpo Järvinen 13b9c5f605 PCI/ASPM: Avoid link retraining race
[ Upstream commit e7e39756363ad5bd83ddeae1063193d0f13870fd ]

PCIe r6.0.1, sec 7.5.3.7, recommends setting the link control parameters,
then waiting for the Link Training bit to be clear before setting the
Retrain Link bit.

This avoids a race where the LTSSM may not use the updated parameters if it
is already in the midst of link training because of other normal link
activity.

Wait for the Link Training bit to be clear before toggling the Retrain Link
bit to ensure that the LTSSM uses the updated link control parameters.

[bhelgaas: commit log, return 0 (success)/-ETIMEDOUT instead of bool for
both pcie_wait_for_retrain() and the existing pcie_retrain_link()]
Suggested-by: Lukas Wunner <lukas@wunner.de>
Fixes: 7d715a6c1a ("PCI: add PCI Express ASPM support")
Link: https://lore.kernel.org/r/20230502083923.34562-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-03 10:23:50 +02:00
..
aer_inject.c PCI/AER: Update aer-inject URL 2022-03-02 11:26:17 -06:00
aer.c PCI/AER: Iterate over error counters instead of error strings 2022-07-13 14:45:20 -05:00
aspm.c PCI/ASPM: Avoid link retraining race 2023-08-03 10:23:50 +02:00
dpc.c PCI/DPC: Await readiness of secondary bus after reset 2023-03-10 09:34:31 +01:00
edr.c PCI/EDR: Clear Device Status after EDR error recovery 2023-05-11 23:03:28 +09:00
err.c PCI/ERR: Recognize disconnected devices in report_error_detected() 2022-06-08 15:08:40 -05:00
Kconfig PCI/AER: Update aer-inject URL 2022-03-02 11:26:17 -06:00
Makefile PCI/ERR: Reduce compile time for CONFIG_PCIEAER=n 2021-10-16 09:16:59 -05:00
pme.c PCI/PME: Use PCI_POSSIBLE_ERROR() to check config reads 2021-11-18 14:13:18 -06:00
portdrv_core.c PCI/portdrv: Don't disable AER reporting in get_port_device_capability() 2022-07-13 14:43:40 -05:00
portdrv_pci.c PCI: portdrv: Set driver_managed_dma 2022-04-28 15:32:20 +02:00
portdrv.h PCI/portdrv: Remove unused pcie_port_bus_{,un}register() declarations 2021-10-15 14:25:18 -05:00
ptm.c PCI/PTM: Reorder functions in logical order 2022-09-12 15:29:52 -05:00
rcec.c PCI/RCEC: Fix RCiEP device to RCEC association 2021-03-10 15:10:46 -06:00