]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: imx6: Wait for retraining
authorMarek Vasut <marex@denx.de>
Wed, 19 Feb 2014 20:22:18 +0000 (13:22 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 19 Feb 2014 21:54:45 +0000 (14:54 -0700)
commit8eae9040b94565d0d77f0dc3c5b4cbf29730eefe
tree4ded9996fcb51cb63f68b652be0ecb465e44ab78
parent6333ef0a6d756a72c48035feae2450b64f0372e4
PCI: imx6: Wait for retraining

This patch handles the case where the PCIe link is up and running, yet
drops into the LTSSM training mode. The link spends short time in the LTSSM
training mode, but the current code can misinterpret it as the link being
stalled.  Waiting for the LTSSM training to complete fixes the issue.

Quoting Sascha:

  This is broken since commit 30af6c36e891 ('PCI: imx6: Report "link up"
  only after link training completes').

  The designware driver changes the PORT_LOGIC_SPEED_CHANGE bit in
  dw_pcie_host_init() which causes the link to be retrained. During the
  next call to dw_pcie_rd_conf() the link is then reported being down and
  the function returns PCIBIOS_DEVICE_NOT_FOUND resulting in nonfunctioning
  PCIe.

Fixes: 30af6c36e891 (PCI: imx6: Report "link up" only after link training completes)
Tested-by: Troy Kisky <troy.kisky@boundarydevices.com>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
drivers/pci/host/pci-imx6.c