Skip to content

Commit 70a7bfb

Browse files
damien-lemoalbjorn-helgaas
authored andcommitted
PCI: rockchip-host: Wait 100ms after reset before starting configuration
PCIe r6.0, sec 6.6.1, states that the host should wait for at least 100 msec from the end of a conventional reset (PERST# is de-asserted) before sending a configuration request to ensure that the device is able to respond with a "Request Retry Status" completion. Add the PCIE_T_RRS_READY_MS macro to define this wait time and modify rockchip_pcie_host_init_port() to add this 100ms sleep after deasserting PERST# using the ep_gpio GPIO. Link: https://lore.kernel.org/linux-pci/[email protected] Suggested-by: Bjorn Helgaas <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent c47f90b commit 70a7bfb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/pci/controller/pcie-rockchip-host.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ static int rockchip_pcie_host_init_port(struct rockchip_pcie *rockchip)
325325
msleep(PCIE_T_PVPERL_MS);
326326
gpiod_set_value_cansleep(rockchip->ep_gpio, 1);
327327

328+
msleep(PCIE_T_RRS_READY_MS);
329+
328330
/* 500ms timeout value should be enough for Gen1/2 training */
329331
err = readl_poll_timeout(rockchip->apb_base + PCIE_CLIENT_BASIC_STATUS1,
330332
status, PCIE_LINK_UP(status), 20,

drivers/pci/pci.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
/* Power stable to PERST# inactive from PCIe card Electromechanical Spec */
1717
#define PCIE_T_PVPERL_MS 100
1818

19+
/*
20+
* End of conventional reset (PERST# de-asserted) to first configuration
21+
* request (device able to respond with a "Request Retry Status" completion),
22+
* from PCIe r6.0, sec 6.6.1.
23+
*/
24+
#define PCIE_T_RRS_READY_MS 100
25+
1926
/*
2027
* PCIe r6.0, sec 5.3.3.2.1 <PME Synchronization>
2128
* Recommends 1ms to 10ms timeout to check L2 ready.

0 commit comments

Comments
 (0)