From patchwork Mon Mar 21 01:00:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 599923 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qSyNP5qcMz9s5M for ; Mon, 21 Mar 2016 12:07:17 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qSyNP4jkqzDqJ9 for ; Mon, 21 Mar 2016 12:07:17 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from russell.cc (russell.cc [IPv6:2404:9400:2:0:216:3eff:fee0:3370]) (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 3qSyN65LSvzDqDV for ; Mon, 21 Mar 2016 12:07:02 +1100 (AEDT) Received: from snap.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10]) by russell.cc (OpenSMTPD) with ESMTPSA id 4fd47a58 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO; Mon, 21 Mar 2016 01:00:26 +0000 (UTC) From: Russell Currey To: skiboot@lists.ozlabs.org Date: Mon, 21 Mar 2016 12:00:05 +1100 Message-Id: <1458522006-8846-7-git-send-email-ruscur@russell.cc> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1458522006-8846-1-git-send-email-ruscur@russell.cc> References: <1458522006-8846-1-git-send-email-ruscur@russell.cc> Subject: [Skiboot] [PATCH V2 6/7] hmi: Only raise a catchall HMI if no other components have X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 Reviewed-by: Alistair Popple Reviewed-by: Mahesh Salgaonkar --- 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. */