From patchwork Tue Nov 15 10:10:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 694947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tJ395314Gz9t37 for ; Tue, 15 Nov 2016 21:12:25 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tJ39528f5zDvr4 for ; Tue, 15 Nov 2016 21:12:25 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tJ37p3XnczDvj0 for ; Tue, 15 Nov 2016 21:11:18 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAFA8tgT099576 for ; Tue, 15 Nov 2016 05:11:15 -0500 Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [125.16.236.5]) by mx0b-001b2d01.pphosted.com with ESMTP id 26qu8ynp71-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 15 Nov 2016 05:11:15 -0500 Received: from localhost by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 Nov 2016 15:41:11 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp05.in.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 15 Nov 2016 15:41:09 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id CB08D1258060 for ; Tue, 15 Nov 2016 15:42:01 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAFAB88727394200 for ; Tue, 15 Nov 2016 15:41:08 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uAFAB7RV011238 for ; Tue, 15 Nov 2016 15:41:07 +0530 Received: from mukesh-ThinkPad-T450.in.ibm.com (mukesh-thinkpad-t450.in.ibm.com [9.124.35.243] (may be forged)) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uAFAAkQP009643; Tue, 15 Nov 2016 15:41:07 +0530 From: Mukesh Ojha To: stewart@linux.vnet.ibm.com, skiboot@lists.ozlabs.org Date: Tue, 15 Nov 2016 15:40:45 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479204645-2865-1-git-send-email-mukesh02@linux.vnet.ibm.com> References: <1479204645-2865-1-git-send-email-mukesh02@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111510-0016-0000-0000-00000374937C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111510-0017-0000-0000-0000276C537F Message-Id: <1479204645-2865-10-git-send-email-mukesh02@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-15_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611150188 Subject: [Skiboot] [PATCH V8 9/9] errorlog: Add generic elog write interface X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 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" Lets add generic error log write interface to send OPAL generated logs to host OS. If platform provides error log commit hook, then call that hook and let platform decide where to commit errors. Otherwise call this generic interface so that logs are sent to host OS. Also move opal_elog_init() call to core/init.c so that elog is initialized for all platform. Signed-off-by: Vasant Hegde Reviewed-by: Mukesh Ojha --- Changes in V8: - Previous version V7 1/12 to 3/12 is already in the master. - Rebased on master. Changes in V7: - New patch. core/errorlog.c | 10 ++++++---- core/init.c | 4 ++++ platforms/astbmc/common.c | 3 --- platforms/ibm-fsp/common.c | 3 --- platforms/qemu/qemu.c | 2 -- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/core/errorlog.c b/core/errorlog.c index a00cf0b..b2a0a3f 100644 --- a/core/errorlog.c +++ b/core/errorlog.c @@ -170,15 +170,17 @@ void log_commit(struct errorlog *elog) /* Increments the number of users using error log buffer */ get_elog(elog); + /* + * If platform doesn't provide elog commit hook, then call generic + * commit interface to send ELOG to host OS. + */ if (platform.elog_commit) { rc = platform.elog_commit(elog); if (rc) prerror("ELOG: Platform commit error %d\n", rc); - - return; + } else { + elog_append_write_to_host(elog); } - - opal_elog_complete(elog, false); } void log_append_data(struct errorlog *buf, unsigned char *data, uint16_t size) diff --git a/core/init.c b/core/init.c index 9d4ab60..112d787 100644 --- a/core/init.c +++ b/core/init.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -875,6 +876,9 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt) /* Register routine to dispatch and read sensors */ sensor_init(); + /* Initialize the error log framework */ + opal_elog_init(); + /* * Initialize the opal messaging before platform.init as we are * getting request to queue occ load opal message when host services diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c index c25f6a6..b0bf117 100644 --- a/platforms/astbmc/common.c +++ b/platforms/astbmc/common.c @@ -121,9 +121,6 @@ void astbmc_init(void) /* Register the BT interface with the IPMI layer */ bt_init(); - /* Initialize error log */ - opal_elog_init(); - ipmi_sel_init(); ipmi_wdt_init(); ipmi_rtc_init(); diff --git a/platforms/ibm-fsp/common.c b/platforms/ibm-fsp/common.c index 17622a3..07928de 100644 --- a/platforms/ibm-fsp/common.c +++ b/platforms/ibm-fsp/common.c @@ -93,9 +93,6 @@ void ibm_fsp_init(void) /* Get ready to receive OCC related messages */ occ_fsp_init(); - /* Initialize the error log framework */ - opal_elog_init(); - /* Get ready to receive Memory [Un]corretable Error messages. */ fsp_memory_err_init(); diff --git a/platforms/qemu/qemu.c b/platforms/qemu/qemu.c index 73415a4..23667ba 100644 --- a/platforms/qemu/qemu.c +++ b/platforms/qemu/qemu.c @@ -92,8 +92,6 @@ static void qemu_init(void) /* Register the BT interface with the IPMI layer */ bt_init(); - /* Initialize error log */ - opal_elog_init(); ipmi_sel_init(); ipmi_wdt_init(); ipmi_opal_init();