diff mbox series

[U-Boot,031/126] pci: Add more debug detail when resources are exhausted

Message ID 20190925145750.200592-32-sjg@chromium.org
State Accepted
Delegated to: Bin Meng
Headers show
Series x86: Add initial support for apollolake | expand

Commit Message

Simon Glass Sept. 25, 2019, 2:56 p.m. UTC
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>
---

 drivers/pci/pci_auto_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bin Meng Oct. 5, 2019, 1:12 p.m. UTC | #1
On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
>
> 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>
> ---
>
>  drivers/pci/pci_auto_common.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Oct. 6, 2019, 11:19 a.m. UTC | #2
On Sat, Oct 5, 2019 at 9:12 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > 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>
> > ---
> >
> >  drivers/pci/pci_auto_common.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86/next, thanks!
Bin Meng Oct. 7, 2019, 1:40 a.m. UTC | #3
On Sun, Oct 6, 2019 at 7:19 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Sat, Oct 5, 2019 at 9:12 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > 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>
> > > ---
> > >
> > >  drivers/pci/pci_auto_common.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> >
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
> applied to u-boot-x86/next, thanks!

It turns out we need do the following to eliminate build warnings on
some boards:

diff --git a/drivers/pci/pci_auto_common.c b/drivers/pci/pci_auto_common.c
index bb56a3d..8690316 100644
--- a/drivers/pci/pci_auto_common.c
+++ b/drivers/pci/pci_auto_common.c
@@ -45,8 +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, avail start=%x / size=%x,
need=%x\n",
-                     res->bus_lower, res->size, size);
+               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;
        }

Applied the above fix in the same commit, and now in u-boot-x86/next.

Regards,
Bin
diff mbox series

Patch

diff --git a/drivers/pci/pci_auto_common.c b/drivers/pci/pci_auto_common.c
index 84908e6154c..bb56a3d3fea 100644
--- a/drivers/pci/pci_auto_common.c
+++ b/drivers/pci/pci_auto_common.c
@@ -45,7 +45,8 @@  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=%x / size=%x, need=%x\n",
+		      res->bus_lower, res->size, size);
 		goto error;
 	}