[Skiboot] [PATCH V2 6/7] hmi: Only raise a catchall HMI if no other components have

Russell Currey ruscur at russell.cc
Mon Mar 21 12:00:05 AEDT 2016


Regardless of whether a handler for a specific component has raised an
event to deal with a HMI or not, skiboot will raise an extra HMI at the
end of the detection.  This is problematic, as if one component reports
it is recoverable but another reports it is not, the last handler to be
called will have priority.

Rework this to instead only send a HMI event if no handler has raised an
event themselves.  This will send an unknown, unrecoverable HMI event
since the cause could not be found.

Signed-off-by: Russell Currey <ruscur at russell.cc>
Reviewed-by: Alistair Popple <alistair at popple.id.au>
Reviewed-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
---
V2: Small cleanups, no functional change
---
 core/hmi.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/core/hmi.c b/core/hmi.c
index 71fdf48..a4c7869 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -439,7 +439,7 @@ static void find_nx_checkstop_reason(int flat_chip_id,
 	*event_generated = 1;
 }
 
-static int decode_malfunction(struct OpalHMIEvent *hmi_evt)
+static void decode_malfunction(struct OpalHMIEvent *hmi_evt)
 {
 	int i;
 	int recover = -1;
@@ -471,10 +471,9 @@ static int decode_malfunction(struct OpalHMIEvent *hmi_evt)
 			hmi_evt->u.xstop_error.xstop_type =
 						CHECKSTOP_TYPE_UNKNOWN;
 			hmi_evt->u.xstop_error.xstop_reason = 0;
+			queue_hmi_event(hmi_evt, recover);
 		}
 	}
-
-	return recover;
 }
 
 static void wait_for_subcore_threads(void)
@@ -700,12 +699,9 @@ int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt)
 	/* Assert if we see malfunction alert, we can not continue. */
 	if (hmer & SPR_HMER_MALFUNCTION_ALERT) {
 		hmer &= ~SPR_HMER_MALFUNCTION_ALERT;
-		recover = 0;
 
-		if (hmi_evt) {
-			recover = decode_malfunction(hmi_evt);
-			queue_hmi_event(hmi_evt, recover);
-		}
+		if (hmi_evt)
+			decode_malfunction(hmi_evt);
 	}
 
 	/* Assert if we see Hypervisor resource error, we can not continue. */
-- 
2.7.3



More information about the Skiboot mailing list