]> www.infradead.org Git - users/willy/linux.git/commitdiff
PCI/PM: Adjust pcie_wait_for_link_delay() for caller delay
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 15 May 2020 19:31:16 +0000 (14:31 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 15 May 2020 19:32:15 +0000 (14:32 -0500)
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: 4827d63891b6 ("PCI/PM: Add pcie_wait_for_link_delay()")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c

index dfa7ec0089635f0ab25a0ab86f029d1738705aba..a4efc7e0061f57c1e9878c4f5ab56b5f696e3726 100644 (file)
@@ -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;
        }