Skip to content

Commit b262518

Browse files
konradybciobjorn-helgaas
authored andcommitted
PCI: dwc: Use msleep() in dw_pcie_wait_for_link()
According to [1], msleep should be used for large sleeps, such as the 100-ish ms one in this function. Comply with the guide and use it. [1] https://docs.kernel.org/timers/timers-howto.html [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Konrad Dybcio <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Johan Hovold <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 96447ed commit b262518

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
655655
if (dw_pcie_link_up(pci))
656656
break;
657657

658-
usleep_range(LINK_WAIT_USLEEP_MIN, LINK_WAIT_USLEEP_MAX);
658+
msleep(LINK_WAIT_SLEEP_MS);
659659
}
660660

661661
if (retries >= LINK_WAIT_MAX_RETRIES) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363

6464
/* Parameters for the waiting for link up routine */
6565
#define LINK_WAIT_MAX_RETRIES 10
66-
#define LINK_WAIT_USLEEP_MIN 90000
67-
#define LINK_WAIT_USLEEP_MAX 100000
66+
#define LINK_WAIT_SLEEP_MS 90
6867

6968
/* Parameters for the waiting for iATU enabled routine */
7069
#define LINK_WAIT_MAX_IATU_RETRIES 5

0 commit comments

Comments
 (0)