Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sinan Kaya and committed by
Bjorn Helgaas
e78e661f 821cdad5

+13 -3
+13 -3
drivers/pci/probe.c
··· 1876 1876 */ 1877 1877 while (pci_bus_crs_vendor_id(*l)) { 1878 1878 if (delay > timeout) { 1879 - printk(KERN_WARNING "pci %04x:%02x:%02x.%d: not responding\n", 1880 - pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), 1881 - PCI_FUNC(devfn)); 1879 + pr_warn("pci %04x:%02x:%02x.%d: not ready after %dms; giving up\n", 1880 + pci_domain_nr(bus), bus->number, 1881 + PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1); 1882 + 1882 1883 return false; 1883 1884 } 1885 + if (delay >= 1000) 1886 + pr_info("pci %04x:%02x:%02x.%d: not ready after %dms; waiting\n", 1887 + pci_domain_nr(bus), bus->number, 1888 + PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1); 1884 1889 1885 1890 msleep(delay); 1886 1891 delay *= 2; ··· 1893 1888 if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, l)) 1894 1889 return false; 1895 1890 } 1891 + 1892 + if (delay >= 1000) 1893 + pr_info("pci %04x:%02x:%02x.%d: ready after %dms\n", 1894 + pci_domain_nr(bus), bus->number, 1895 + PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1); 1896 1896 1897 1897 return true; 1898 1898 }