Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2588377imm; Mon, 16 Jul 2018 10:27:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/PosL++Uq2jBdaYeK+XynMW+515Q587G1834dz261gqgOcIb12wd/piBLm77LzFiq5jfb X-Received: by 2002:a63:121a:: with SMTP id h26-v6mr16660176pgl.316.1531762077367; Mon, 16 Jul 2018 10:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531762077; cv=none; d=google.com; s=arc-20160816; b=S8+rNqg1e/qN91XNhtitEwonh5G1yZa7tmNUukz97L414JCBD+mbh+pQIaM2H+SBFr rpqQRJWNxCmLFVmGSp4/CKxhCJbN0jr7DsyPhZVYSOSMk1c0//TcfFOL/AHHN1EMcVuX bhm2z8txTembiAzQicko+cC/npvwcstV21/k8vB57YmCVaANJh7Kdi+H+2Dn8fhzCntM 7xF+JFoa+j6MLWPmz0FuTk1Ersh3VEUy7upk+7r3wTDcPjvGkMHlFA9K7QTbYH6rGabP EshZgA98L/RGLujwhg5trxTvzKVxBv5QH8Cc6FjtWWkjxcHCJv2AZ3ocBY1MwpjrJ3bZ BycQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=hGyLD67datvvdPRy8wC825h7q+uqWeY7lanMuZ5DXFA=; b=uRhCiPwHwc8bInIkPRcFi2Zei3UOP2w1UjirC3ypTNyCysnZqAUY6MW3sdvcPzNkF1 XNTxYb+DwHVKf+tnkoWnE0rNSa85x+eawjcqyrbJXzj40ndbNlCnCkldtpFgpio/xNKO p/+aJnGAHKjRY6ZU7rgXEY0LNO4JZpPzc8NGMiVtWSLbFNZYEUG0uVUnype2jUsHvm6I XU2dOarF1EpnqZl1C/zXTludhqHQV19goQIkmTZRc0mfDzFsW6g7maUX92w2byU9l9Y/ v2eDygh3dW89z8hZBqjhuxZcnz6jubuADke9Z55f/P661a6hIkajPcSBntxlgc9WbNfC klFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=du0OOoAp; dkim=pass header.i=@codeaurora.org header.s=default header.b=GlkgCNAM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14-v6si15755799pgd.306.2018.07.16.10.27.42; Mon, 16 Jul 2018 10:27:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=du0OOoAp; dkim=pass header.i=@codeaurora.org header.s=default header.b=GlkgCNAM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729350AbeGPRzb (ORCPT + 99 others); Mon, 16 Jul 2018 13:55:31 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57804 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeGPRzb (ORCPT ); Mon, 16 Jul 2018 13:55:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7C54960116; 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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 Cc: Tyler Baicar 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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'; -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.