Skip to content

Commit

Permalink
PCI/PM: Adjust pcie_wait_for_link_delay() for caller delay
Browse files Browse the repository at this point in the history
The caller of pcie_wait_for_link_delay() specifies the time to wait after
the link becomes active.  When the downstream port doesn't support link
active reporting, obviously we can't tell when the link becomes active, so
we waited the worst-case time (1000 ms) plus 100 ms, ignoring the delay
from the caller.

Instead, wait for 1000 ms + the delay from the caller.

Fixes: 4827d63 ("PCI/PM: Add pcie_wait_for_link_delay()")
Signed-off-by: Bjorn Helgaas <[email protected]>
  • Loading branch information
bjorn-helgaas committed May 15, 2020
1 parent 68f5fc4 commit f044baa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4675,10 +4675,10 @@ static bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active,

/*
* Some controllers might not implement link active reporting. In this
* case, we wait for 1000 + 100 ms.
* case, we wait for 1000 ms + any delay requested by the caller.
*/
if (!pdev->link_active_reporting) {
msleep(1100);
msleep(timeout + delay);
return true;
}

Expand Down

0 comments on commit f044baa

Please sign in to comment.