aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci/pci_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/pci_pci.c')
-rw-r--r--sys/dev/pci/pci_pci.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index 2b86f2f50e11..cecf75024d3f 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -2364,7 +2364,20 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r,
start, end));
#ifdef PCI_RES_BUS
- if (type != PCI_RES_BUS)
+ if (type == PCI_RES_BUS) {
+ /*
+ * If our bus range isn't big enough to grow the sub-allocation
+ * then we need to grow our bus range. Any request that would
+ * require us to decrease the start of our own bus range is
+ * invalid, we can only extend the end; ignore such requests
+ * and let rman_adjust_resource fail below.
+ */
+ if (start >= sc->bus.sec && end > sc->bus.sub) {
+ error = pcib_grow_subbus(&sc->bus, end);
+ if (error != 0)
+ return (error);
+ }
+ } else
#endif
{
/*