From patchwork Mon Dec 4 10:16:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Ze Liao X-Patchwork-Id: 844458 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yrHw40f5cz9s7f for ; Tue, 5 Dec 2017 08:25:08 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yrHw36BTjzDrCb for ; Tue, 5 Dec 2017 08:25:07 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=cn.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=liaomz@cn.ibm.com; receiver=) 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 3yr14r1xMyzDwNF for ; Mon, 4 Dec 2017 21:16:43 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB4AE8Pb131856 for ; Mon, 4 Dec 2017 05:16:41 -0500 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.67]) by mx0a-001b2d01.pphosted.com with ESMTP id 2en4b38cnw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 Dec 2017 05:16:40 -0500 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Mon, 4 Dec 2017 10:16:40 -0000 Received: from us1a3-smtp08.a3.dal06.isc4sb.com (10.146.103.57) by smtp.notes.na.collabserv.com (10.106.227.16) with smtp.notes.na.collabserv.com ESMTP; Mon, 4 Dec 2017 10:16:38 -0000 Received: from us1a3-mail135.a3.dal06.isc4sb.com ([10.146.45.12]) by us1a3-smtp08.a3.dal06.isc4sb.com with ESMTP id 2017120410163612-324157 ; Mon, 4 Dec 2017 10:16:36 +0000 MIME-Version: 1.0 To: skiboot@lists.ozlabs.org, "Stewart Smith" From: "Meng Ze Liao" Date: Mon, 4 Dec 2017 18:16:33 +0800 X-KeepSent: 45E83ECD:5BEA13D8-482581EC:00380268; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1FP7 Octobe4, 2013 X-LLNOutbound: False X-Disclaimed: 8547 X-TNEFEvaluated: 1 Content-type: multipart/mixed; Boundary="0__=C7BB0B7FDFAB84F88f9e8a93df938690918cC7BB0B7FDFAB84F8" x-cbid: 17120410-0327-0000-0000-0000031827E4 X-IBM-SpamModules-Scores: BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.423878; ST=0; TS=0; UL=0; ISC=; MB=0.008414 X-IBM-SpamModules-Versions: BY=3.00008152; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000243; SDB=6.00955239; UDB=6.00482766; IPR=6.00735276; BA=6.00005727; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018332; XFM=3.00000015; UTC=2017-12-04 10:16:39 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2017-12-04 06:47:20 - 6.00007712 x-cbparentid: 17120410-0328-0000-0000-00003B1228F2 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-04_03:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-Mailman-Approved-At: Tue, 05 Dec 2017 08:25:05 +1100 Subject: [Skiboot] Skiboot patch for using opal_cec_reboot before OPAL_BOOT_COMPLETE X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeremy Kerr Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Hi Ozlabs, The following code will replace the platform cec reboot by opal_cec_reboot which can also trigger the soft reboot as OS booted. Could you please help review the code change? Thanks! (See attached file: opal_fast_reboot_001.patch) #endif /* __PLATFORM_H */ Best regards Mengze Liao OpenPOWER AE IBM GCG Systems & Technology Group Lab diff --git a/core/platform.c b/core/platform.c index 732f67e..f1e98cb 100644 --- a/core/platform.c +++ b/core/platform.c @@ -50,7 +50,7 @@ static int64_t opal_cec_power_down(uint64_t request) } opal_call(OPAL_CEC_POWER_DOWN, opal_cec_power_down, 1); -static int64_t opal_cec_reboot(void) +int64_t opal_cec_reboot(void) { prlog(PR_NOTICE, "OPAL: Reboot request...\n"); diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c index 3386854..2d6adb0 100644 --- a/hw/ipmi/ipmi-sel.c +++ b/hw/ipmi/ipmi-sel.c @@ -25,6 +25,7 @@ #include #include #include +#include /* OEM SEL fields */ #define SEL_OEM_ID_0 0x55 @@ -515,10 +516,9 @@ static void sel_power(uint8_t power) break; case SOFT_REBOOT: prlog(PR_NOTICE, "Soft reboot requested\n"); - if (!(debug_descriptor.state_flags & OPAL_BOOT_COMPLETE) && - platform.cec_reboot) { + if (!(debug_descriptor.state_flags & OPAL_BOOT_COMPLETE)) { prlog(PR_NOTICE, "Host not up, rebooting now\n"); - platform.cec_reboot(); + opal_cec_reboot(); } else { opal_queue_msg(OPAL_MSG_SHUTDOWN, NULL, NULL, SOFT_REBOOT); } diff --git a/include/platform.h b/include/platform.h index f3af390..fc9527d 100644 --- a/include/platform.h +++ b/include/platform.h @@ -217,4 +217,5 @@ extern int wait_for_resource_loaded(enum resource_id id, uint32_t idx); extern void set_bmc_platform(const struct bmc_platform *bmc); +extern int64_t opal_cec_reboot(void);