From patchwork Mon Jul 16 17:26:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baicar X-Patchwork-Id: 10527323 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 8581A60348 for ; Mon, 16 Jul 2018 17:27:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DA2128DE9 for ; Mon, 16 Jul 2018 17:27:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 623C128DFC; Mon, 16 Jul 2018 17:27:27 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0CFE828DE9 for ; Mon, 16 Jul 2018 17:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Tq57m3BBGc1MdkpTIvZGWAjogZgefBKVISWLaBfqYQA=; b=nQD tlt3vooWVqnexHL2dGHmAEdmJhSNNVnJWtQjq5BVDpt2CJQ6Ksvl+IwGEbjnSG94B9PO3yas9Ywq0 FNaaNTxd4UM4yPpcPvP1G+qqwhideqxZYOFMUNYuY7sMxNK+gRhMWOFOsIiDwVYKJcMiA5mfFutJH hnXIxrdeR9XiHfWzI+4zEwJn7ov7p+jJXjJomcBbzcdcmaVI4Wy7JoS9u7cEvZb3PURFvYPRfG3R+ 1I8/n/q9DSJSjIbvn5C/iVA3mYQCmrTvF3bMw495GJg3eIhOF/7HsPmobCbotvjr46jqaeYJoocgh ga5j63ShRyNLEIuEyVHer2aOFY7nR+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ff7HO-00007q-7x; Mon, 16 Jul 2018 17:27:22 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ff7HK-00006w-GE for linux-arm-kernel@lists.infradead.org; Mon, 16 Jul 2018 17:27:19 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 98C9A60274; Mon, 16 Jul 2018 17:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531762027; bh=QJdZpNi8qMydP1Xd4hWIpXPaqLS4X1aS6qoZoXYYlCg=; h=From:To:Cc:Subject:Date:From; b=du0OOoApiDUuLb5RWu0y8VWX3Jf+Ha/n1yT3/kVVZm3W6hYGTfycs6rdGddbHk+Ez 4y/6nP/+8SuB5v4JychQPQpl53W0ukjQOtxhuQCLztwt2MbdR8z0Ous6TOBtcLosuG pudQuZa4d6/7UN7lKHQ7ZXMi0498cDh1EISTFtXU= Received: from thunderhorn.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tbaicar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id F230060274; Mon, 16 Jul 2018 17:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531762026; bh=QJdZpNi8qMydP1Xd4hWIpXPaqLS4X1aS6qoZoXYYlCg=; h=From:To:Cc:Subject:Date:From; b=GlkgCNAMY3cnTRSSncJIX4Lqi4BC+Bmd7UAop9uns6tPvwcc+CxG98ilhCSXIUDFV 3fAccbJIKr1mrVBB70h5EYktfw7cpthJKPjHOHqpA8/zsIjCYhktjYuOhXRW6Ed9mV IRxG+PdpQu+E4q8VQtg3STguFvYwckygLtZ0ePHQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F230060274 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org From: Tyler Baicar To: mchehab@kernel.org, bp@alien8.de, james.morse@arm.com, linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] EDAC, ghes: Enable per-layer error reporting for ARM Date: Mon, 16 Jul 2018 13:26:49 -0400 Message-Id: <1531762009-15112-1-git-send-email-tbaicar@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180716_102718_564479_D13BB8D5 X-CRM114-Status: GOOD ( 13.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tyler Baicar MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Enable per-layer error reporting for ARM systems so that the error counters are incremented per-DIMM. On ARM systems that use firmware first error handling it is understood that card=channel and module=DIMM on that channel. Populate that information and enable per layer error reporting for ARM systems so that the EDAC error counters are incremented based on DIMM number as per the SMBIOS table rather than just incrementing the noinfo counters on the memory controller. Signed-off-by: Tyler Baicar --- drivers/edac/ghes_edac.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 473aeec..e4c8b6e 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -213,9 +213,18 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) strcpy(e->label, "unknown label"); e->msg = pvt->msg; e->other_detail = pvt->other_detail; - e->top_layer = -1; - e->mid_layer = -1; - e->low_layer = -1; + if ((IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64)) + && (mem_err->validation_bits & CPER_MEM_VALID_CARD) + && (mem_err->validation_bits & CPER_MEM_VALID_MODULE)) { + e->top_layer = mem_err->card; + e->mid_layer = mem_err->module; + e->low_layer = -1; + e->enable_per_layer_report = true; + } else { + e->top_layer = -1; + e->mid_layer = -1; + e->low_layer = -1; + } *pvt->other_detail = '\0'; *pvt->msg = '\0';