summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Quinlan <jim2101024@gmail.com>2022-10-11 14:42:07 -0400
committerLorenzo Pieralisi <lpieralisi@kernel.org>2022-11-11 11:40:47 +0100
commit3ae140ad827b359bc4fa7c7985691c4c1e3ca8f4 (patch)
treed73bc4e3b583fff917e58e1516fa088f627662a5
parent198acab1772f22f2e91f68a2fc1331e91dad780a (diff)
downloadlinux-stable-3ae140ad827b359bc4fa7c7985691c4c1e3ca8f4.tar.gz
linux-stable-3ae140ad827b359bc4fa7c7985691c4c1e3ca8f4.tar.bz2
linux-stable-3ae140ad827b359bc4fa7c7985691c4c1e3ca8f4.zip
PCI: brcmstb: Wait for 100ms following PERST# deassert
Be prudent and give some time for power and clocks to become stable. As described in the PCIe CEM specification sections 2.2 and 2.2.1; as well as PCIe r5.0, 6.6.1. Link: https://lore.kernel.org/r/20221011184211.18128-3-jim2101024@gmail.com Signed-off-by: Jim Quinlan <jim2101024@gmail.com> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-rw-r--r--drivers/pci/controller/pcie-brcmstb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index a45ce7d61847..39b545713ba0 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1037,8 +1037,15 @@ static int brcm_pcie_start_link(struct brcm_pcie *pcie)
pcie->perst_set(pcie, 0);
/*
- * Give the RC/EP time to wake up, before trying to configure RC.
- * Intermittently check status for link-up, up to a total of 100ms.
+ * Wait for 100ms after PERST# deassertion; see PCIe CEM specification
+ * sections 2.2, PCIe r5.0, 6.6.1.
+ */
+ msleep(100);
+
+ /*
+ * Give the RC/EP even more time to wake up, before trying to
+ * configure RC. Intermittently check status for link-up, up to a
+ * total of 100ms.
*/
for (i = 0; i < 100 && !brcm_pcie_link_up(pcie); i += 5)
msleep(5);