summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinan Kaya <okaya@codeaurora.org>2017-08-29 21:45:45 +0200
committerBjorn Helgaas <bhelgaas@google.com>2017-08-29 21:45:45 +0200
commite78e661fae3296c4e20a029d6bd04c5e925c72de (patch)
treec790cc8163fbc6c291044546d9f8f4f65215d667
parentPCI: Wait up to 60 seconds for device to become ready after FLR (diff)
downloadlinux-e78e661fae3296c4e20a029d6bd04c5e925c72de.tar.xz
linux-e78e661fae3296c4e20a029d6bd04c5e925c72de.zip
PCI: Warn periodically while waiting for non-CRS ("device ready") status
Add a print statement in pci_bus_wait_crs() so that user observes the progress of device polling instead of silently waiting for timeout to be reached. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> [bhelgaas: check for timeout first so we don't print "waiting, giving up", always print time we've slept (not the actual timeout, print a "ready" message if we've printed a "waiting" message] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/probe.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f09d8cd3df7a..9b8a445b9294 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1876,11 +1876,16 @@ static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
*/
while (pci_bus_crs_vendor_id(*l)) {
if (delay > timeout) {
- printk(KERN_WARNING "pci %04x:%02x:%02x.%d: not responding\n",
- pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
- PCI_FUNC(devfn));
+ pr_warn("pci %04x:%02x:%02x.%d: not ready after %dms; giving up\n",
+ pci_domain_nr(bus), bus->number,
+ PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1);
+
return false;
}
+ if (delay >= 1000)
+ pr_info("pci %04x:%02x:%02x.%d: not ready after %dms; waiting\n",
+ pci_domain_nr(bus), bus->number,
+ PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1);
msleep(delay);
delay *= 2;
@@ -1889,6 +1894,11 @@ static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
return false;
}
+ if (delay >= 1000)
+ pr_info("pci %04x:%02x:%02x.%d: ready after %dms\n",
+ pci_domain_nr(bus), bus->number,
+ PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1);
+
return true;
}