Skip to content

Commit 8884b56

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Add debug print when releasing resources before retry
PCI resource fitting is somewhat hard to track because it performs many actions without logging them. In the case inside __assign_resources_sorted(), the resources are released before resource assignment is going to be retried in a different order. That is just one level of retries the resource fitting performs overall so tracking it through repeated assignments or failures of a resource gets messy rather quickly. Simply announce the release explicitly using pci_dbg() so it is clear what is going on with each resource. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Xiaochun Lee <[email protected]>
1 parent 07854e0 commit 8884b56

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/pci/setup-bus.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ static void __assign_resources_sorted(struct list_head *head,
408408
struct pci_dev_resource *save_res;
409409
struct pci_dev_resource *dev_res, *tmp_res, *dev_res2;
410410
struct resource *res;
411+
struct pci_dev *dev;
412+
const char *res_name;
413+
int idx;
411414
unsigned long fail_type;
412415
resource_size_t add_align, align;
413416

@@ -497,9 +500,16 @@ static void __assign_resources_sorted(struct list_head *head,
497500
/* Release assigned resource */
498501
list_for_each_entry(dev_res, head, list) {
499502
res = dev_res->res;
503+
dev = dev_res->dev;
504+
505+
if (!res->parent)
506+
continue;
507+
508+
idx = pci_resource_num(dev, res);
509+
res_name = pci_resource_name(dev, idx);
510+
pci_dbg(dev, "%s %pR: releasing\n", res_name, res);
500511

501-
if (res->parent)
502-
release_resource(res);
512+
release_resource(res);
503513
}
504514
/* Restore start/end/flags from saved list */
505515
list_for_each_entry(save_res, &save_head, list)

0 commit comments

Comments
 (0)