From patchwork Mon Nov 25 07:15:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gong X-Patchwork-Id: 3228171 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E5D5C045B for ; Mon, 25 Nov 2013 07:32:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1771E20265 for ; Mon, 25 Nov 2013 07:32:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 267E520253 for ; Mon, 25 Nov 2013 07:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752357Ab3KYHcT (ORCPT ); Mon, 25 Nov 2013 02:32:19 -0500 Received: from mga11.intel.com ([192.55.52.93]:7847 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752454Ab3KYHcT (ORCPT ); Mon, 25 Nov 2013 02:32:19 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 24 Nov 2013 23:32:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,766,1378882800"; d="scan'208";a="439107656" Received: from gchen-sby.bj.intel.com (HELO localhost) ([10.238.158.82]) by fmsmga002.fm.intel.com with ESMTP; 24 Nov 2013 23:32:00 -0800 From: "Chen, Gong" To: tony.luck@intel.com, bp@alien8.de, naveen.n.rao@linux.vnet.ibm.com Cc: linux-acpi@vger.kernel.org, "Chen, Gong" Subject: [PATCH v2 1/2] ACPI, APEI, GHES: Remove strict check for memory error handling Date: Mon, 25 Nov 2013 02:15:00 -0500 Message-Id: <1385363701-12387-1-git-send-email-gong.chen@linux.intel.com> X-Mailer: git-send-email 1.8.4.3 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Usually SCI is employed to handle corrected error, especially for memory corrected error but in fact SCI still can be used to handle any error like memory uncorrected error even fatal error if BIOS enable it. For this kind of situation, it should be logged, too. v2 -> v1: make the event record more precisely Signed-off-by: Chen, Gong Acked-by: Borislav Petkov Acked-by: Naveen N. Rao --- arch/x86/kernel/cpu/mcheck/mce-apei.c | 10 +++++++--- drivers/acpi/apei/ghes.c | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce-apei.c b/arch/x86/kernel/cpu/mcheck/mce-apei.c index de8b60a..d137ab8 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-apei.c +++ b/arch/x86/kernel/cpu/mcheck/mce-apei.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "mce-internal.h" @@ -41,14 +42,17 @@ void apei_mce_report_mem_error(int corrected, struct cper_sec_mem_err *mem_err) { struct mce m; - /* Only corrected MC is reported */ - if (!corrected || !(mem_err->validation_bits & CPER_MEM_VALID_PA)) + if (!(mem_err->validation_bits & CPER_MEM_VALID_PA)) return; mce_setup(&m); m.bank = 1; - /* Fake a memory read corrected error with unknown channel */ + /* Fake a memory read error with unknown channel */ m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | 0x9f; + if (corrected >= GHES_SEV_RECOVERABLE) + m.status |= MCI_STATUS_UC; + if (corrected >= GHES_SEV_PANIC) + m.status |= MCI_STATUS_PCC; m.addr = mem_err->physical_addr; mce_log(&m); mce_notify_irq(); diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index a30bc31..ce3683d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -453,8 +453,7 @@ static void ghes_do_proc(struct ghes *ghes, ghes_edac_report_mem_error(ghes, sev, mem_err); #ifdef CONFIG_X86_MCE - apei_mce_report_mem_error(sev == GHES_SEV_CORRECTED, - mem_err); + apei_mce_report_mem_error(sev, mem_err); #endif ghes_handle_memory_failure(gdata, sev); }