Skip to content

Commit d7467bc

Browse files
floatiousMani-Sadhasivam
authored andcommitted
PCI: Move link up wait time and max retries macros to pci.h
Move the LINK_WAIT_SLEEP_MS and LINK_WAIT_MAX_RETRIES macros to pci.h. Prefix the macros with PCIE_ in order to avoid redefining these for drivers that already have macros named like this. No functional changes. Suggested-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 80dc18a commit d7467bc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

drivers/pci/controller/dwc/pcie-designware.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,14 +702,14 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
702702
int retries;
703703

704704
/* Check if the link is up or not */
705-
for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) {
705+
for (retries = 0; retries < PCIE_LINK_WAIT_MAX_RETRIES; retries++) {
706706
if (dw_pcie_link_up(pci))
707707
break;
708708

709-
msleep(LINK_WAIT_SLEEP_MS);
709+
msleep(PCIE_LINK_WAIT_SLEEP_MS);
710710
}
711711

712-
if (retries >= LINK_WAIT_MAX_RETRIES) {
712+
if (retries >= PCIE_LINK_WAIT_MAX_RETRIES) {
713713
dev_info(pci->dev, "Phy link never came up\n");
714714
return -ETIMEDOUT;
715715
}

drivers/pci/controller/dwc/pcie-designware.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@
6262
#define dw_pcie_cap_set(_pci, _cap) \
6363
set_bit(DW_PCIE_CAP_ ## _cap, &(_pci)->caps)
6464

65-
/* Parameters for the waiting for link up routine */
66-
#define LINK_WAIT_MAX_RETRIES 10
67-
#define LINK_WAIT_SLEEP_MS 90
68-
6965
/* Parameters for the waiting for iATU enabled routine */
7066
#define LINK_WAIT_MAX_IATU_RETRIES 5
7167
#define LINK_WAIT_IATU 9

drivers/pci/pci.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ struct pcie_tlp_log;
5656
*/
5757
#define PCIE_RESET_CONFIG_WAIT_MS 100
5858

59+
/* Parameters for the waiting for link up routine */
60+
#define PCIE_LINK_WAIT_MAX_RETRIES 10
61+
#define PCIE_LINK_WAIT_SLEEP_MS 90
62+
5963
/* Message Routing (r[2:0]); PCIe r6.0, sec 2.2.8 */
6064
#define PCIE_MSG_TYPE_R_RC 0
6165
#define PCIE_MSG_TYPE_R_ADDR 1

0 commit comments

Comments
 (0)