]> git.hungrycats.org Git - linux/commit
PCI: Work around Pericom PCIe-to-PCI bridge Retrain Link erratum
authorStefan Mätje <stefan.maetje@esd.eu>
Fri, 29 Mar 2019 17:07:35 +0000 (18:07 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:11:39 +0000 (21:11 +0100)
commit57b9ed53b9ade4b1bb4950eafd21ccb0fb46a6db
tree6562f6aa07bd818e027e8cb770b46a2302a6057d
parent9a070ca281b04d1490eac3f2d62cde20855177ac
PCI: Work around Pericom PCIe-to-PCI bridge Retrain Link erratum

commit 4ec73791a64bab25cabf16a6067ee478692e506d upstream.

Due to an erratum in some Pericom PCIe-to-PCI bridges in reverse mode
(conventional PCI on primary side, PCIe on downstream side), the Retrain
Link bit needs to be cleared manually to allow the link training to
complete successfully.

If it is not cleared manually, the link training is continuously restarted
and no devices below the PCI-to-PCIe bridge can be accessed.  That means
drivers for devices below the bridge will be loaded but won't work and may
even crash because the driver is only reading 0xffff.

See the Pericom Errata Sheet PI7C9X111SLB_errata_rev1.2_102711.pdf for
details.  Devices known as affected so far are: PI7C9X110, PI7C9X111SL,
PI7C9X130.

Add a new flag, clear_retrain_link, in struct pci_dev.  Quirks for affected
devices set this bit.

Note that pcie_retrain_link() lives in aspm.c because that's currently the
only place we use it, but this erratum is not specific to ASPM, and we may
retrain links for other reasons in the future.

Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
[bhelgaas: apply regardless of CONFIG_PCIEASPM]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[bwh: Backported to 3.16:
 - Use dev_info() instead of pci_info()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/pci/pcie/aspm.c
drivers/pci/quirks.c
include/linux/pci.h