Thread (35 messages) 35 messages, 5 authors, 2025-11-13
STALE199d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 14/24] PCI: Warn if bridge window cannot be released when resizing BAR

From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Date: 2025-08-22 14:58:27
Also in: linux-m68k, linux-mips, linux-pci, lkml, sparclinux
Subsystem: pci subsystem, the rest · Maintainers: Bjorn Helgaas, Linus Torvalds

BAR resizing calls to pci_reassign_bridge_resources() that 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. The code just silently continues when
this condition is detects.

Add pci_warn() to inform user that a bridge window could not be
released because of child resources. As too small bridge window is
often the reason why the BAR resize cannot succeed, this warning will
help to pinpoint to the cause.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/setup-bus.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 5ef6362b5166..55289cd58e2c 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -2556,6 +2556,10 @@ int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *res)
 				goto cleanup;
 
 			pci_release_resource(bridge, i);
+		} else {
+			pci_warn(bridge,
+				 "%s %pR: was not released (still contains assigned resources)\n",
+				 res_name, res);
 		}
 
 		bus = bus->parent;
-- 
2.39.5

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help