Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp475227imm; Thu, 30 Aug 2018 03:44:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYtMD5IEyGHf1qiCmrRxobd7jMagvRvYItTCqQlBRke8PZ+Wcx7OZimXeAUzVAatzfWqZSn X-Received: by 2002:a17:902:b7c5:: with SMTP id v5-v6mr9880050plz.49.1535625892840; Thu, 30 Aug 2018 03:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535625892; cv=none; d=google.com; s=arc-20160816; b=BDu2dINrEX5eRQPKkST6iy4Q3ynIBch01GTJeraE0iuhCpiGGIgaww5+GHYJUNw/o1 xDSzNG5wqH2SmKlKcWe7Mz7bSNrGrjPNhwKQvqEgRSDRmS31ALtR/Ce0qkWtreExXhBq Lz+hf8fxEHoZmDqcFQU9O2CUtpWKmx/wb10g0mpOXVRBjImq7LQwJcLhx/GmZTZbqiSQ xJeiM0Cywdm2iBBI8nRhNLQT2La/HDH1BbtbnbRV7xAp8flOFq+jyipSbW4tFzrL2/sy uafGoj7jOTOWr2r8ljVOhw7/t5U1F1bMXn0kKuVKRzEZb9Dl/W9bGjZodrsJ15wIQCze 2pWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zEJ9Ui8z0QaCw3NbzzdS6+7OeERRonEsLPFakgtFOjA=; b=e4Z3hKeULRp+PM2jOsNmzyXL92trsL0mU8jBcwbZzdLJyRrgMdET6lD8ix72DQ8VCM +9QF9nFjrQ2xPBVZ4ybdgKQoWTunm1cOkE5yuTmBkHkWxF3XDc/VgWep/EnUM3J76mor QsM9gpQXu0znt8WOXJTL0F8SEoPGd9e4vX8ESNLQAVqGGCfrZ3FxfPILPS/FRhY6T85K b9dJFqA3sDwW9PUrSUvHBOplle7BaxVKIhkmOwbzjHLYHUKGISy5uWlj9OkIOtU1C1T7 /TjVv4Ckww1macugpR1Wn3MWqUNfnAA27a3oSDY+99reNg2xMk6HYFbqpZRgdsZ8KdKe DP8g== ARC-Authentication-Results: i=1; mx.google.com; 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 x66-v6si6368175pfx.129.2018.08.30.03.44.37; Thu, 30 Aug 2018 03:44:52 -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; 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 S1728418AbeH3Ooa (ORCPT + 99 others); Thu, 30 Aug 2018 10:44:30 -0400 Received: from mail.skyhub.de ([5.9.137.197]:45124 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728318AbeH3Ooa (ORCPT ); Thu, 30 Aug 2018 10:44:30 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3gHDOsgZy2sx; Thu, 30 Aug 2018 12:42:40 +0200 (CEST) Received: from nazgul.tnic (46-10-68-224.ip.btc-net.bg [46.10.68.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 90EFE1EC0253; Thu, 30 Aug 2018 12:42:40 +0200 (CEST) Date: Thu, 30 Aug 2018 12:43:07 +0200 From: Borislav Petkov To: Fan Wu Cc: mchehab@kernel.org, james.morse@arm.com, baicar.tyler@gmail.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Kani, Toshi" Subject: Re: [PATCH] EDAC, ghes: use CPER module handles to locate DIMMs Message-ID: <20180830104307.GC20005@nazgul.tnic> References: <1535567632-18089-1-git-send-email-wufan@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1535567632-18089-1-git-send-email-wufan@codeaurora.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 29, 2018 at 06:33:52PM +0000, Fan Wu wrote: > The current ghes_edac driver does not update per-dimm error > counters when reporting memory errors, because there is no > platform-independent way to find DIMMs based on the error > information provided by firmware. This patch offers a solution > for platforms whose firmwares provide valid module handles > (SMBIOS type 17) in error records. In this case ghes_edac will > use the module handles to locate DIMMs and thus makes per-dimm > error reporting possible. > > Signed-off-by: Fan Wu > --- > drivers/edac/ghes_edac.c | 36 +++++++++++++++++++++++++++++++++--- > include/linux/edac.h | 2 ++ > 2 files changed, 35 insertions(+), 3 deletions(-) If we're going to do this, it needs to be tested on an x86 box which loads ghes_edac. Adding Toshi to Cc. Otherwise it must remain ARM-specific. > diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c > index 473aeec..db527f0 100644 > --- a/drivers/edac/ghes_edac.c > +++ b/drivers/edac/ghes_edac.c > @@ -81,6 +81,26 @@ static void ghes_edac_count_dimms(const struct dmi_header *dh, void *arg) > (*num_dimm)++; > } > > +static int ghes_edac_dimm_index(u16 handle) get_dimm_smbios_handle() > +{ > + struct mem_ctl_info *mci; > + int i; > + > + if (!ghes_pvt) > + return -1; You don't need that test. > + > + mci = ghes_pvt->mci; > + > + if (!mci) > + return -1; Ditto. > + > + for (i = 0; i < mci->tot_dimms; i++) { > + if (mci->dimms[i]->smbios_handle == handle) > + return i; > + } > + return -1; > +} > + > static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) > { > struct ghes_edac_dimm_fill *dimm_fill = arg; -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --