linux-stable/drivers/pci/pcie
Ilpo Järvinen a922770cd4 PCI/ASPM: Avoid link retraining race
[ Upstream commit e7e3975636 ]

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-11 11:45:29 +02:00
..
aer.c
aer_inject.c
aspm.c PCI/ASPM: Avoid link retraining race 2023-08-11 11:45:29 +02:00
dpc.c
err.c
Kconfig
Makefile
pme.c
portdrv.h
portdrv_core.c
portdrv_pci.c
ptm.c PCI/PTM: Inherit Switch Downstream Port PTM settings from Upstream Port 2020-06-25 15:32:58 +02:00