[Skiboot] [PATCH v9 12/22] core/pci: Allow for serialized jobs

Gavin Shan gwshan at linux.vnet.ibm.com
Thu Nov 12 13:33:19 AEDT 2015


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.

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

diff --git a/core/pci.c b/core/pci.c
index 54509c6..22a4675 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -22,6 +22,8 @@
 #include <device.h>
 #include <fsp.h>
 
+//#define PCI_SERIALIZED_JOBS
+
 #define MAX_PHB_ID	256
 static struct phb *phbs[MAX_PHB_ID];
 
@@ -1471,6 +1473,7 @@ void pci_reset(void)
 	}
 }
 
+#ifndef PCI_SERIALIZED_JOBS
 static void pci_do_jobs(void (*fn)(void *))
 {
 	struct cpu_job **jobs;
@@ -1502,16 +1505,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