diff mbox series

[1/5] opal/errorlog: Allow generation of Serviceable attention events

Message ID 159599140359.66951.8000579209303137333.stgit@jupiter
State Superseded
Headers show
Series Add support to report EEH errors to BMC/FSP (eSEL) | expand

Commit Message

Mahesh J Salgaonkar July 29, 2020, 2:56 a.m. UTC
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

Add support to mark error log event as Serviceable/Customer attention
events.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
 core/errorlog.c    |    5 +++++
 core/pel.c         |    3 +++
 include/errorlog.h |    2 ++
 include/pel.h      |    1 +
 4 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/core/errorlog.c b/core/errorlog.c
index f64ac3f23..2f7bcce19 100644
--- a/core/errorlog.c
+++ b/core/errorlog.c
@@ -73,6 +73,11 @@  struct errorlog *opal_elog_create(struct opal_err_info *e_info, uint32_t tag)
 	return buf;
 }
 
+void log_mark_serviceable(struct errorlog *buf)
+{
+	buf->service_req = true;
+}
+
 /* Add a new user data section to an existing error log */
 void log_add_section(struct errorlog *buf, uint32_t tag)
 {
diff --git a/core/pel.c b/core/pel.c
index ec13e5590..4b2656346 100644
--- a/core/pel.c
+++ b/core/pel.c
@@ -160,6 +160,9 @@  static void create_user_header_section(struct errorlog *elog_data,
 	else
 		usrhdr->action_flags = cpu_to_be16(ERRL_ACTION_NONE);
 
+	if (elog_data->service_req)
+		usrhdr->action_flags |= ERRL_ACTION_SERVICE;
+
 	*pel_offset += USER_HEADER_SECTION_SIZE;
 }
 
diff --git a/include/errorlog.h b/include/errorlog.h
index a443d3681..74fe8b1fd 100644
--- a/include/errorlog.h
+++ b/include/errorlog.h
@@ -124,6 +124,7 @@  struct errorlog {
 	uint32_t plid;
 	uint32_t log_size;
 	uint64_t elog_timeout;
+	bool service_req;
 
 	char user_data_dump[OPAL_LOG_MAX_DUMP];
 	struct list_node link;
@@ -350,6 +351,7 @@  void log_append_data(struct errorlog *buf, unsigned char *data, uint16_t size);
 void log_append_msg(struct errorlog *buf,
 		const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
 void log_commit(struct errorlog *elog);
+void log_mark_serviceable(struct errorlog *buf);
 
 /* Called by the backend after an error has been logged by the
  * backend. If the error could not be logged successfully success is
diff --git a/include/pel.h b/include/pel.h
index a0df7cc3c..252d27e2e 100644
--- a/include/pel.h
+++ b/include/pel.h
@@ -38,6 +38,7 @@ 
 
 /* Error log reporting action */
 #define ERRL_ACTION_REPORT     0x2000
+#define ERRL_ACTION_SERVICE    0x8000
 #define ERRL_ACTION_NONE       0x0000
 
 enum elogSectionId {