[Skiboot] [PATCH] PCI: only wait 20ms for PHB logic to settle if we detected any PHBs

Stewart Smith stewart at linux.vnet.ibm.com
Wed Jun 7 17:48:51 AEST 2017


Otherwise, in simulators such as Mambo, we needlessly wait 20ms, which
takes much longer than 20ms to do, because simulator.

Fixes: 41b14f9452c25f3dd74a8304763a3cc58bff019f
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 core/pci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/pci.c b/core/pci.c
index 2d3c4f88541b..ec2416701015 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1644,7 +1644,12 @@ void pci_init_slots(void)
 	/* Some PHBs may need that long to debounce the presence detect
 	 * after HW initialization.
 	 */
-	time_wait_ms(20);
+	for (i = 0; i < ARRAY_SIZE(phbs); i++) {
+		if (phbs[i]) {
+			time_wait_ms(20);
+			break;
+		}
+	}
 
 	prlog(PR_NOTICE, "PCI: Resetting PHBs...\n");
 	pci_do_jobs(pci_reset_phb);
-- 
2.9.4



More information about the Skiboot mailing list