From patchwork Mon Apr 16 21:59:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10343947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6AB216039A for ; Mon, 16 Apr 2018 21:59:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5826628921 for ; Mon, 16 Apr 2018 21:59:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C52028924; Mon, 16 Apr 2018 21:59:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF16928921 for ; Mon, 16 Apr 2018 21:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753070AbeDPV7f (ORCPT ); Mon, 16 Apr 2018 17:59:35 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:41256 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752848AbeDPV7V (ORCPT ); Mon, 16 Apr 2018 17:59:21 -0400 Received: by mail-ot0-f196.google.com with SMTP id m22-v6so19175456otf.8; Mon, 16 Apr 2018 14:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+RJzjxSxWkY0karShsFmQqvdvSNUVTEQ+pu1FZPA16I=; b=KKPMtTdS+PW5ymQbaOqEDCtUc0yotqKu6gbx6FEh8iukCmsBd+aaVuppOOT46izu/E wAMMRy/nt4q8EPBc+UMst8ZVnVQBTebMkM4ukbr6u23x8o6laD/MCHNONIDn1lqd5I0F hyolxtONL6jiUFq9zM7TmDnc8Lv12Z90AX+SYdWP1AsH85DfuVXAR2BZDYLknsLMZU7h 3pO3xJ0Iou3WCLcSrL+yyCrNUgesRii+SY7R4yIy//EreV6XiRaiieHu9YSNJLTC0Aq1 vEBq2FEl2q/MPBkwy4rbTQ8DaYi+A2htuvJX8KOYRlVUxZGs47cw+0y7byTCwcdzYVTS ACYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+RJzjxSxWkY0karShsFmQqvdvSNUVTEQ+pu1FZPA16I=; b=UQM62ihelyt1Zwb3GCylD7vsU9ruzf5BTeqSfKNuUO7wyZwJpGRcBqNRd9SM0YrH0X eVWq+ietK0etjngC/XKJLbUV3P3pcx1PbLoJ7QqaEX2qYR+xT6FdxaRvMeukchtOZuH2 HNskhky3T9VaZP2bt1rW9I7aSRI58skXI9AY1Z3Z0Av30nJTVWDp0vvA7lIFyJAD+fFH LSoDn2EzJLoisRiMS3tJ6QvFRE5P/FPNlHz2C3jNYP93FXY/5XTDlaPunt2bp+lLm4UV 4KA7y4HxrGCfXFN9TpVBz6TrjXff5tOCC8G7DQ8UOHHwFe6+YD8374epb+GxzazgW49W 5BDw== X-Gm-Message-State: ALQs6tBLYi5ReogzCC+lrD4jov+jyweImMNyjFYzN3qnKJ2l6o83eO+e /+KtJwPRCnG96p2gznEal4bO9ppA X-Google-Smtp-Source: AIpwx483S3Y5xy+jGuZ72f56quDyQ4BqxCfCmKYai4+5guy7FJF4oB+EyzzVE1c7wAKfu+5DUFxnQg== X-Received: by 2002:a9d:4312:: with SMTP id s18-v6mr12029638ote.187.1523915960137; Mon, 16 Apr 2018 14:59:20 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-197-2-30.hsd1.tx.comcast.net. [98.197.2.30]) by smtp.gmail.com with ESMTPSA id j23-v6sm8219960oiy.22.2018.04.16.14.59.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 14:59:19 -0700 (PDT) From: Alexandru Gagniuc To: linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org Cc: rjw@rjwysocki.net, lenb@kernel.org, tony.luck@intel.com, bp@alien8.de, tbaicar@codeaurora.org, will.deacon@arm.com, james.morse@arm.com, shiju.jose@huawei.com, zjzhang@codeaurora.org, gengdongjiu@huawei.com, linux-kernel@vger.kernel.org, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, devel@acpica.org, mchehab@kernel.org, robert.moore@intel.com, erik.schmauss@intel.com, Alexandru Gagniuc Subject: [RFC PATCH v2 4/4] acpi: apei: Warn when GHES marks correctable errors as "fatal" Date: Mon, 16 Apr 2018 16:59:03 -0500 Message-Id: <20180416215903.7318-5-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180416215903.7318-1-mr.nuke.me@gmail.com> References: <20180416215903.7318-1-mr.nuke.me@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There seems to be a culture amongst BIOS teams to want to crash the OS when an error can't be handled in firmware. Marking GHES errors as "fatal" is a very common way to do this. However, a number of errors reported by GHES may be fatal in the sense a device or link is lost, but are not fatal to the system. When there is a disagreement with firmware about the handleability of an error, print a warning message. Signed-off-by: Alexandru Gagniuc --- drivers/acpi/apei/ghes.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index e0528da4e8f8..6a117825611d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -535,13 +535,14 @@ static const struct ghes_handler *get_handler(const guid_t *type) static void ghes_do_proc(struct ghes *ghes, const struct acpi_hest_generic_status *estatus) { - int sev, sec_sev; + int sev, sec_sev, corrected_sev; struct acpi_hest_generic_data *gdata; const struct ghes_handler *handler; guid_t *sec_type; guid_t *fru_id = &NULL_UUID_LE; char *fru_text = ""; + corrected_sev = GHES_SEV_NO; sev = ghes_severity(estatus->error_severity); apei_estatus_for_each_section(estatus, gdata) { sec_type = (guid_t *)gdata->section_type; @@ -563,6 +564,13 @@ static void ghes_do_proc(struct ghes *ghes, sec_sev, err, gdata->error_data_length); } + + corrected_sev = max(corrected_sev, sec_sev); + } + + if ((sev >= GHES_SEV_PANIC) && (corrected_sev < sev)) { + pr_warn("FIRMWARE BUG: Firmware sent fatal error that we were able to correct"); + pr_warn("BROKEN FIRMWARE: Complain to your hardware vendor"); } }