From 9253de5bcab2800c1ac1f5372ba5354543fa2e67 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Wed, 7 Jun 2017 17:11:45 +1000 Subject: PCI: only wait 20ms for PHB logic to settle if we detected any PHBs 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 --- core/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/pci.c') diff --git a/core/pci.c b/core/pci.c index 2d3c4f8..ec24167 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); -- cgit v1.1