[Skiboot] [PATCH v10 08/17] core/pci: Option for serialized jobs

Gavin Shan gwshan at linux.vnet.ibm.com
Tue May 3 15:04:33 AEST 2016


Currently, the PHB reset and PCI enumeration are done concurrently
on multiple CPU cores. The output messages are interleaved and not
readable enough. This adds a option to do the jobs in serialized
fashion for debugging purpose only. The serialized mode should be
always disabled in field.

Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 core/pci.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/core/pci.c b/core/pci.c
index b835a6d..e05ed6c 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1478,6 +1478,7 @@ void pci_reset(void)
 	}
 }
 
+#ifndef PCI_SERIALIZED_JOBS
 static void pci_do_jobs(void (*fn)(void *))
 {
 	struct cpu_job **jobs;
@@ -1509,16 +1510,33 @@ static void pci_do_jobs(void (*fn)(void *))
 	}
 	free(jobs);
 }
+#endif /* !PCI_SERIALIZED_JOBS */
 
 void pci_init_slots(void)
 {
 	unsigned int i;
 
+#ifdef PCI_SERIALIZED_JOBS
+	prlog(PR_NOTICE, "PCI: Resetting PHBs...\n");
+	for (i = 0; i < ARRAY_SIZE(phbs); i++) {
+		if (!phbs[i])
+			continue;
+		pci_reset_phb(phbs[i]);
+	}
+
+	prlog(PR_NOTICE, "PCI: Probing slots...\n");
+	for (i = 0; i < ARRAY_SIZE(phbs); i++) {
+		if (!phbs[i])
+			continue;
+		pci_scan_phb(phbs[i]);
+	}
+#else
 	prlog(PR_NOTICE, "PCI: Resetting PHBs...\n");
 	pci_do_jobs(pci_reset_phb);
 
 	prlog(PR_NOTICE, "PCI: Probing slots...\n");
 	pci_do_jobs(pci_scan_phb);
+#endif
 
 	if (platform.pci_probe_complete)
 		platform.pci_probe_complete();
-- 
2.1.0



More information about the Skiboot mailing list