]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: aardvark: Fix checking for link up via LTSSM state
authorPali Rohár <pali@kernel.org>
Tue, 5 Oct 2021 18:09:51 +0000 (20:09 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 7 Oct 2021 13:27:59 +0000 (14:27 +0100)
commit31e2f0efea26ff926ed0acf7a9ec55eb5ee1b8ab
treefb32905ed3bd3ec340f8489746cbbb013dec99ad
parent68fa22b931441e789e42aba702e0973a0d64d75b
PCI: aardvark: Fix checking for link up via LTSSM state

Current implementation of advk_pcie_link_up() is wrong as it marks also
link disabled or hot reset states as link up.

Fix it by marking link up only to those states which are defined in PCIe
Base specification 3.0, Table 4-14: Link Status Mapped to the LTSSM.

To simplify implementation, Define macros for every LTSSM state which
aardvark hardware can return in CFG_REG register.

Fix also checking for link training according to the same Table 4-14.
Define a new function advk_pcie_link_training() for this purpose.

Link: https://lore.kernel.org/r/20211005180952.6812-13-kabel@kernel.org
Fixes: 08fd7d0c64af ("PCI: aardvark: Add Aardvark PCI host controller driver")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Marek Behún <kabel@kernel.org>
Cc: stable@vger.kernel.org
Cc: Remi Pommarel <repk@triplefau.lt>
drivers/pci/controller/pci-aardvark.c