pci: Add more debug detail when resources are exhausted
authorSimon Glass <sjg@chromium.org>
Wed, 25 Sep 2019 14:56:15 +0000 (08:56 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 8 Oct 2019 05:57:42 +0000 (13:57 +0800)
If PCI auto-config runs out of memory, show a few more details to help
diagnose the problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: change %x to %llx to avoid build warnings on some platforms]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
drivers/pci/pci_auto_common.c

index 84908e6154c568a3382381aeda2baeaa3ebef01e..86903166101b6732bae0d19c82c69a0ff50d7fae 100644 (file)
@@ -45,7 +45,9 @@ int pciauto_region_allocate(struct pci_region *res, pci_size_t size,
        addr = ((res->bus_lower - 1) | (size - 1)) + 1;
 
        if (addr - res->bus_start + size > res->size) {
-               debug("No room in resource");
+               debug("No room in resource, avail start=%llx / size=%llx, "
+                     "need=%llx\n", (unsigned long long)res->bus_lower,
+                     (unsigned long long)res->size, (unsigned long long)size);
                goto error;
        }