]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Revert to the original speed after PCIe failed link retraining
authorMaciej W. Rozycki <macro@orcam.me.uk>
Fri, 9 Aug 2024 13:24:51 +0000 (14:24 +0100)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Mon, 9 Sep 2024 13:58:25 +0000 (13:58 +0000)
commitf68dea13405c94381d08f42dbf0416261622bdad
treeccd41b3a6120b8dbae33f2fb77320a26fcb458b5
parent8037ac08c2bbb3186f83a5a924f52d1048dbaec5
PCI: Revert to the original speed after PCIe failed link retraining

When `pcie_failed_link_retrain' has failed to retrain the link by hand
it leaves the link speed restricted to 2.5GT/s, which will then affect
any device that has been plugged in later on, which may not suffer from
the problem that caused the speed restriction to have been attempted.
Consequently such a downstream device will suffer from an unnecessary
communication throughput limitation and therefore performance loss.

Remove the speed restriction then and revert the Link Control 2 register
to its original state if link retraining with the speed restriction in
place has failed.  Retrain the link again afterwards so as to remove any
residual state, waiting on LT rather than DLLLA to avoid an excessive
delay and ignoring the result as this training is supposed to fail
anyway.

Fixes: a89c82249c37 ("PCI: Work around PCIe link training failures")
Link: https://lore.kernel.org/linux-pci/alpine.DEB.2.21.2408251412590.30766@angie.orcam.me.uk
Reported-by: Matthew W Carlis <mattc@purestorage.com>
Link: https://lore.kernel.org/r/20240806000659.30859-1-mattc@purestorage.com/
Link: https://lore.kernel.org/r/20240722193407.23255-1-mattc@purestorage.com/
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: <stable@vger.kernel.org> # v6.5+
drivers/pci/quirks.c