Skiboot patch for using opal_cec_reboot before OPAL_BOOT_COMPLETE

Message ID OF45E83ECD.5BEA13D8-ON482581EC.00380268-482581EC.003872B6@notes.na.collabserv.com
State New
Headers show
Series
  • Skiboot patch for using opal_cec_reboot before OPAL_BOOT_COMPLETE
Related show

Commit Message

Meng Ze Liao Dec. 4, 2017, 10:16 a.m.
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

Patch

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 <errorlog.h>
 #include <pel.h>
 #include <opal-msg.h>
+#include <platform.h>

 /* 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);