Skip to content

Commit 85796d2

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Warn if bridge window cannot be released when resizing BAR
BAR resizing calls to pci_reassign_bridge_resources(), which attempts to release any upstream bridge window to allow them to accommodate the new BAR size. The release can only be performed if there are no other child resources for the bridge window. Previously the code continued silently when other child resources were detected. Add pci_warn() to inform user that a bridge window could not be released because of child resources. As a small bridge window is often the reason why BAR resize fails, this warning will help to pinpoint to the cause. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250829131113.36754-15-ilpo.jarvinen@linux.intel.com
1 parent 3ab10f8 commit 85796d2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/pci/setup-bus.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,12 @@ int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *res)
25552555
goto cleanup;
25562556

25572557
pci_release_resource(bridge, i);
2558+
} else {
2559+
const char *res_name = pci_resource_name(bridge, i);
2560+
2561+
pci_warn(bridge,
2562+
"%s %pR: was not released (still contains assigned resources)\n",
2563+
res_name, res);
25582564
}
25592565

25602566
bus = bus->parent;

0 commit comments

Comments
 (0)