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

Gavin Shan gwshan at linux.vnet.ibm.com
Tue Jun 13 13:48:22 AEST 2017


On Wed, Jun 07, 2017 at 05:48:51PM +1000, Stewart Smith wrote:
>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;
>+		}
>+	}

for_each_phb() can be used here?

> 
> 	prlog(PR_NOTICE, "PCI: Resetting PHBs...\n");
> 	pci_do_jobs(pci_reset_phb);

Cheers,
Gavin



More information about the Skiboot mailing list