Skip to content

Commit 13cab74

Browse files
author
Myron Stowe
committed
PCI: j721e: Deassert PERST# after a delay of PCIE_T_PVPERL_MS milliseconds
JIRA: https://issues.redhat.com/browse/RHEL-67693 Upstream Status: 22a9120 commit 22a9120 Author: Siddharth Vadapalli <[email protected]> Date: Mon Nov 4 13:14:20 2024 +0530 PCI: j721e: Deassert PERST# after a delay of PCIE_T_PVPERL_MS milliseconds According to Section 2.2 of the PCI Express Card Electromechanical Specification (Revision 5.1), in order to ensure that the power and the reference clock are stable, PERST# has to be deasserted after a delay of 100 milliseconds (TPVPERL). Currently, it is being assumed that the power is already stable, which is not necessarily true. Hence, change the delay to PCIE_T_PVPERL_MS to guarantee that power and reference clock are stable. Fixes: f3e2591 ("PCI: j721e: Add TI J721E PCIe driver") Fixes: f96b697 ("PCI: j721e: Use T_PERST_CLK_US macro") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Siddharth Vadapalli <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Myron Stowe <[email protected]>
1 parent 1fa530a commit 13cab74

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

drivers/pci/controller/cadence/pci-j721e.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -572,15 +572,14 @@ static int j721e_pcie_probe(struct platform_device *pdev)
572572
pcie->refclk = clk;
573573

574574
/*
575-
* The "Power Sequencing and Reset Signal Timings" table of the
576-
* PCI Express Card Electromechanical Specification, Revision
577-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
578-
* should be deasserted after minimum of 100us once REFCLK is
579-
* stable. The REFCLK to the connector in RC mode is selected
580-
* while enabling the PHY. So deassert PERST# after 100 us.
575+
* Section 2.2 of the PCI Express Card Electromechanical
576+
* Specification (Revision 5.1) mandates that the deassertion
577+
* of the PERST# signal should be delayed by 100 ms (TPVPERL).
578+
* This shall ensure that the power and the reference clock
579+
* are stable.
581580
*/
582581
if (gpiod) {
583-
fsleep(PCIE_T_PERST_CLK_US);
582+
msleep(PCIE_T_PVPERL_MS);
584583
gpiod_set_value_cansleep(gpiod, 1);
585584
}
586585

@@ -671,15 +670,14 @@ static int j721e_pcie_resume_noirq(struct device *dev)
671670
return ret;
672671

673672
/*
674-
* The "Power Sequencing and Reset Signal Timings" table of the
675-
* PCI Express Card Electromechanical Specification, Revision
676-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
677-
* should be deasserted after minimum of 100us once REFCLK is
678-
* stable. The REFCLK to the connector in RC mode is selected
679-
* while enabling the PHY. So deassert PERST# after 100 us.
673+
* Section 2.2 of the PCI Express Card Electromechanical
674+
* Specification (Revision 5.1) mandates that the deassertion
675+
* of the PERST# signal should be delayed by 100 ms (TPVPERL).
676+
* This shall ensure that the power and the reference clock
677+
* are stable.
680678
*/
681679
if (pcie->reset_gpio) {
682-
fsleep(PCIE_T_PERST_CLK_US);
680+
msleep(PCIE_T_PVPERL_MS);
683681
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
684682
}
685683

0 commit comments

Comments
 (0)