From patchwork Tue Nov 15 10:10:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 694942 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 3tJ38T5WFkz9t2D for ; Tue, 15 Nov 2016 21:11:53 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tJ38T4bnmzDvlf for ; Tue, 15 Nov 2016 21:11:53 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3tJ37k26lxzDvkb for ; Tue, 15 Nov 2016 21:11:14 +1100 (AEDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAFAB9me067606 for ; Tue, 15 Nov 2016 05:11:12 -0500 Received: from e28smtp09.in.ibm.com (e28smtp09.in.ibm.com [125.16.236.9]) by mx0a-001b2d01.pphosted.com with ESMTP id 26qrbuccm6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 15 Nov 2016 05:11:11 -0500 Received: from localhost by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 Nov 2016 15:41:08 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp09.in.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 15 Nov 2016 15:41:07 +0530 Received: from d28relay09.in.ibm.com (d28relay09.in.ibm.com [9.184.220.160]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 7512E394004E for ; Tue, 15 Nov 2016 15:41:06 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay09.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAFAB61H24641638 for ; Tue, 15 Nov 2016 15:41:06 +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 uAFAB5qn011175 for ; Tue, 15 Nov 2016 15:41:05 +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 uAFAAkQN009643; Tue, 15 Nov 2016 15:41:04 +0530 From: Mukesh Ojha To: stewart@linux.vnet.ibm.com, skiboot@lists.ozlabs.org Date: Tue, 15 Nov 2016 15:40:43 +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-0032-0000-0000-00000185C690 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111510-0033-0000-0000-000010C948C4 Message-Id: <1479204645-2865-8-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 7/9] errorlog: Remove the usage of 'elog_init()' routine, replaces it with 'opal_elog_init()' for BMC systems 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" Let us have a single routine 'opal_elog_init()' which initialises the error log infrastructure. As part of the movement, better to move the content of the 'elog_init()' to 'opal_elog_init()' and remove 'elog_init()' routine. Signed-off-by: Mukesh Ojha Reviewed-by: Vasant Hegde --- Changes in V8: - Previous version V7 1/12 to 3/12 is already in the master. - Rebased on master. Changes in V7: - This patch sequence changed from V6 9/12 to V7's 10/11. - Subject tag changed from opal/errorlog to errorlog. Changes in V6: - Rebased on master. Changes in V5: - New patch. core/errorlog.c | 18 ++++++------------ include/errorlog.h | 1 - platforms/astbmc/common.c | 6 ++++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/core/errorlog.c b/core/errorlog.c index e778eae..a00cf0b 100644 --- a/core/errorlog.c +++ b/core/errorlog.c @@ -477,17 +477,6 @@ static bool opal_kexec_elog_notify(void *data __unused) return true; } -int elog_init(void) -{ - /* Pre-allocate memory for records */ - if (pool_init(&elog_pool, sizeof(struct errorlog), - ELOG_WRITE_MAX_RECORD, 1)) - return OPAL_RESOURCE; - - elog_available = true; - return 0; -} - void opal_elog_init(void) { elog_write_to_host_buffer = memalign(TCE_PSIZE, @@ -503,5 +492,10 @@ void opal_elog_init(void) opal_register(OPAL_ELOG_RESEND, opal_resend_pending_logs, 0); opal_register(OPAL_ELOG_SIZE, opal_elog_info, 3); - elog_init(); + /* Pre-allocate memory for records */ + if (pool_init(&elog_pool, sizeof(struct errorlog), + ELOG_WRITE_MAX_RECORD, 1)) + return; + + elog_available = true; } diff --git a/include/errorlog.h b/include/errorlog.h index fa9d4a1..46a9aa7 100644 --- a/include/errorlog.h +++ b/include/errorlog.h @@ -375,7 +375,6 @@ void log_commit(struct errorlog *elog); void opal_elog_complete(struct errorlog *elog, bool success); void opal_elog_init(void); -int elog_init(void); void elog_append_write_to_host(struct errorlog *buf); void elog_set_head_state(bool opal_logs, enum elog_head_state state); diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c index 6e678a1..c25f6a6 100644 --- a/platforms/astbmc/common.c +++ b/platforms/astbmc/common.c @@ -120,8 +120,10 @@ void astbmc_init(void) /* Register the BT interface with the IPMI layer */ bt_init(); - /* Initialize elog */ - elog_init(); + + /* Initialize error log */ + opal_elog_init(); + ipmi_sel_init(); ipmi_wdt_init(); ipmi_rtc_init();