[Skiboot] [PATCH] core/pci.c: Don't reserve PCI slots for non-pluggable slots

Alistair Popple alistair at popple.id.au
Tue May 9 18:00:52 AEST 2017


If a downstream PCIe link is down we currently reserve a number of
busses for hot pluggable devices. However we do not need to do this
when we know a slot is not hotplug capable.

Signed-off-by: Alistair Popple <alistair at popple.id.au>
---
 core/pci.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/core/pci.c b/core/pci.c
index a8b4b69..d69eb28 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -751,13 +751,16 @@ uint8_t pci_scan_bus(struct phb *phb, uint8_t bus, uint8_t max_bus,
 			max_sub = pci_scan_bus(phb, next_bus, max_bus,
 					       &pd->children, pd, true);
 		} else if (!use_max) {
-			/* XXX Empty bridge... we leave room for hotplug
-			 * slots etc.. but we should be smarter at figuring
-			 * out if this is actually a hotpluggable one
+			/* Empty bridge. We leave room for hotplug
+			 * slots if the downstream port is pluggable.
 			 */
-			max_sub = next_bus + 4;
-			if (max_sub > max_bus)
-				max_sub = max_bus;
+			if (pd->slot && !pd->slot->pluggable)
+				max_sub = next_bus;
+			else {
+				max_sub = next_bus + 4;
+				if (max_sub > max_bus)
+					max_sub = max_bus;
+			}
 		}
 
 		/* Update the max subordinate as described previously */
-- 
2.1.4



More information about the Skiboot mailing list