From patchwork Thu Nov 12 02:33:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 543177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 26B01141301 for ; Thu, 12 Nov 2015 13:34:58 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 0C1611A0352 for ; Thu, 12 Nov 2015 13:34:58 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 10B6C1A0228 for ; Thu, 12 Nov 2015 13:34:55 +1100 (AEDT) Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Nov 2015 12:34:54 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 12 Nov 2015 12:34:53 +1000 X-Helo: d23dlp01.au.ibm.com X-MailFrom: gwshan@linux.vnet.ibm.com X-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id A2F092CE8056 for ; Thu, 12 Nov 2015 13:34:52 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAC2YjQ420775160 for ; Thu, 12 Nov 2015 13:34:54 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAC2YJ6m027330 for ; Thu, 12 Nov 2015 13:34:20 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tAC2YJvY026531; Thu, 12 Nov 2015 13:34:19 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 5A0D0A03E8; Thu, 12 Nov 2015 13:33:36 +1100 (AEDT) Received: from gwshan (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 4FE5FE46AC; Thu, 12 Nov 2015 13:33:36 +1100 (AEDT) Received: by gwshan (Postfix, from userid 1000) id 29B8094212B; Thu, 12 Nov 2015 13:33:36 +1100 (AEDT) From: Gavin Shan To: skiboot@lists.ozlabs.org Date: Thu, 12 Nov 2015 13:33:19 +1100 Message-Id: <1447295609-20446-13-git-send-email-gwshan@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1447295609-20446-1-git-send-email-gwshan@linux.vnet.ibm.com> References: <1447295609-20446-1-git-send-email-gwshan@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15111202-0029-0000-0000-0000026BB8C1 Subject: [Skiboot] [PATCH v9 12/22] core/pci: Allow for serialized jobs X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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 #include +//#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();