]> git.hungrycats.org Git - linux/commit
PCI: cadence: Fix Gen2 Link Retraining process
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Wed, 15 Mar 2023 07:08:00 +0000 (12:38 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:45 +0000 (19:39 +0200)
commitefee5ca159a992975f7c841d436d5b209c4fa917
tree6f2f2a141b517fd347bed9262a606c9113b9e857
parent1d2b603d938c898b5fd8da6e3d80184366ca6ea0
PCI: cadence: Fix Gen2 Link Retraining process

[ Upstream commit 0e12f830236928b6fadf40d917a7527f0a048d2f ]

The Link Retraining process is initiated to account for the Gen2 defect in
the Cadence PCIe controller in J721E SoC. The errata corresponding to this
is i2085, documented at:
https://www.ti.com/lit/er/sprz455c/sprz455c.pdf

The existing workaround implemented for the errata waits for the Data Link
initialization to complete and assumes that the link retraining process
at the Physical Layer has completed. However, it is possible that the
Physical Layer training might be ongoing as indicated by the
PCI_EXP_LNKSTA_LT bit in the PCI_EXP_LNKSTA register.

Fix the existing workaround, to ensure that the Physical Layer training
has also completed, in addition to the Data Link initialization.

Link: https://lore.kernel.org/r/20230315070800.1615527-1-s-vadapalli@ti.com
Fixes: 4740b969aaf5 ("PCI: cadence: Retrain Link to work around Gen2 training defect")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/cadence/pcie-cadence-host.c