Paste
Of Code


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 54d6f4fa3ce1..99800c399f36 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1198,6 +1198,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
                                add_align = max(pci_resource_alignment(dev, r), add_align);
                                add_to_list(realloc_head, dev, r, 0, 0 /* Don't care */);
                                children_add_size += r_size;
+                               pr_err("%s: 1 list empty? %d\n", __func__, list_empty(realloc_head));
                                continue;
                        }
 
@@ -1231,6 +1232,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
                                children_add_size += get_res_add_size(realloc_head, r);
                                children_add_align = get_res_add_align(realloc_head, r);
                                add_align = max(add_align, children_add_align);
+                               pr_err("%s: 2. list empty? %d\n", __func__, list_empty(realloc_head));
                        }
                }
        }
@@ -1251,6 +1253,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
        }
 
        if (realloc_head && (add_size > 0 || children_add_size > 0)) {
+               pr_err("%s: 3. list empty? %d\n", __func__, list_empty(realloc_head));
                add_align = max(min_align, add_align);
                size1 = calculate_memsize(size, min_size, add_size, children_add_size,
                                          resource_size(b_res), add_align);
@@ -1280,6 +1283,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
        b_res->flags |= IORESOURCE_STARTALIGN;
        if (bus->self && size1 > size0 && realloc_head) {
                add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align);
+               pr_err("%s: 4. list empty? %d\n", __func__, list_empty(realloc_head));
                pci_info(bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n",
                           b_res, &bus->busn_res,
                           (unsigned long long) (size1 - size0),
@@ -1509,9 +1513,11 @@ void __pci_bus_size_bridges(struct pci_bus *bus, struct list_head *realloc_head)
                 * that used here. Specifically, we cannot put a 32-bit
                 * prefetchable resource in a 64-bit prefetchable window.
                 */
+               pr_err("%s: before pbus_size_mem. list empty? %d\n", __func__, list_empty(realloc_head));
                pbus_size_mem(bus, mask, IORESOURCE_MEM, type2, type3,
                              realloc_head ? 0 : additional_mmio_size,
                              additional_mmio_size, realloc_head);
+               pr_err("%s: after pbus_size_mem. list empty? %d\n", __func__, list_empty(realloc_head));
                break;
        }
 }
@@ -2492,7 +2498,15 @@ void pci_assign_unassigned_bus_resources(struct pci_bus *bus)
                if (pci_has_subordinate(dev))
                        __pci_bus_size_bridges(dev->subordinate, &add_list);
        up_read(&pci_bus_sem);
+
+       pr_err("%s: before __pci_bus_assign_resources -> list empty? %d\n",
+              __func__, list_empty(&add_list));
+
        __pci_bus_assign_resources(bus, &add_list, NULL);
+
+       pr_err("%s: after __pci_bus_assign_resources -> list empty? %d\n",
+              __func__, list_empty(&add_list));
+
        BUG_ON(!list_empty(&add_list));
 }
 EXPORT_SYMBOL_GPL(pci_assign_unassigned_bus_resources);

Toggle: theme, font