From f3a5741408a11be6992cf8779f2eae10b08c020a Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Fri, 5 May 2017 15:55:28 +1000 Subject: FSP: Notify FSP of Platform Log ID after Host Initiated Reset Reload Trigging a Host Initiated Reset (when the host detects the FSP has gone out to lunch and should be rebooted), would cause "Unknown Command" messages to appear in the OPAL log. This patch implements those messages How to trigger FSP RR(HIR): $ putmemproc 300000f8 0x00000000deadbeef s1 k0:n0:s0:p00 ecmd_ppc putmemproc 300000f8 0x00000000deadbeef Log showing unknown command: / # cat /sys/firmware/opal/msglog | grep -i ,3 [ 110.232114723,3] FSP: fsp_trigger_reset() entry [ 188.431793837,3] FSP #0: Link down, starting R&R [ 464.109239162,3] FSP #0: Got XUP with no pending message ! [ 466.340598554,3] FSP-DPO: Unknown command 0xce0900 [ 466.340600126,3] FSP: Unhandled message ce0900 The message we need to handle is "Get PLID after host initiated FipS reset/reload". When the FSP comes back from HIR, it asks "hey, so, which error log explains why you rebooted me?". So, we tell it. Reported-by: Pridhiviraj Paidipeddi Signed-off-by: Stewart Smith --- core/errorlog.c | 13 ++++++++----- core/opal.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/errorlog.c b/core/errorlog.c index 179e09f..522dfcc 100644 --- a/core/errorlog.c +++ b/core/errorlog.c @@ -1,4 +1,4 @@ -/* Copyright 2013-2016 IBM Corp. +/* Copyright 2013-2017 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -196,7 +196,7 @@ void log_append_msg(struct errorlog *buf, const char *fmt, ...) log_append_data(buf, err_msg, strlen(err_msg)); } -void log_simple_error(struct opal_err_info *e_info, const char *fmt, ...) +uint32_t log_simple_error(struct opal_err_info *e_info, const char *fmt, ...) { struct errorlog *buf; va_list list; @@ -212,10 +212,13 @@ void log_simple_error(struct opal_err_info *e_info, const char *fmt, ...) buf = opal_elog_create(e_info, 0); if (buf == NULL) { prerror("ELOG: Error getting buffer to log error\n"); - } else { - log_append_data(buf, err_msg, strlen(err_msg)); - log_commit(buf); + return -1; } + + log_append_data(buf, err_msg, strlen(err_msg)); + log_commit(buf); + + return buf->plid; } int elog_init(void) diff --git a/core/opal.c b/core/opal.c index 73223b1..14357cc 100644 --- a/core/opal.c +++ b/core/opal.c @@ -30,6 +30,7 @@ #include #include #include +#include /* Pending events to signal via opal_poll_events */ uint64_t opal_pending_events; @@ -51,6 +52,13 @@ static uint64_t opal_dynamic_events; extern uint32_t attn_trigger; extern uint32_t hir_trigger; +/* We make this look like a Surveillance error, even though it really + * isn't one. + */ +DEFINE_LOG_ENTRY(OPAL_INJECTED_HIR, OPAL_MISC_ERR_EVT, OPAL_SURVEILLANCE, + OPAL_SURVEILLANCE_ERR, OPAL_PREDICTIVE_ERR_GENERAL, + OPAL_MISCELLANEOUS_INFO_ONLY); + void opal_table_init(void) { struct opal_table_entry *s = __opal_table_start; @@ -408,7 +416,9 @@ static int64_t opal_poll_events(__be64 *outstanding_event_mask) /* Test the host initiated reset */ if (hir_trigger == 0xdeadbeef) { - fsp_trigger_reset(); + uint32_t plid = log_simple_error(&e_info(OPAL_INJECTED_HIR), + "SURV: Injected HIR, initiating FSP R/R\n"); + fsp_trigger_reset(plid); hir_trigger = 0; } -- cgit v1.1