Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp113712imm; Thu, 30 Aug 2018 09:33:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZpfQ4jgh8VE/hT92EB8tnHW72JfC0ppbaerHUUycMxT5/mh1LUAx46VZiHOGpNZ2i+YGDV X-Received: by 2002:a63:5a65:: with SMTP id k37-v6mr10362625pgm.143.1535646816608; Thu, 30 Aug 2018 09:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535646816; cv=none; d=google.com; s=arc-20160816; b=VrN0+cFOFPyT8Tyx9Z8EGl9kS6xP0aXWIU0x2baFdpddIkH3qXGbOOHv/nEUYMcVpW nJmEqOrcFB4IawBQUAVVUqerJ/KFr0UydMJtMykGMefEeN2xQwueKzlZ9xIaBpYNBLx7 NOMZCsMMweHoAS4CgpxOwJQ4+cjWN0S+FahQpXJEbtLOC5JF5jCPq6NsxnugQ7kavMO5 IOaegYgVNs9qLC2ei75UxTReagUnQImPhagtHiddeHGON90KrRtfM3ILrsVKTqzRfKyg EFtZ4EjDFCVKvLOI2MCDAfi7aCLZm1Bcvze7DGt5DyUs91Wm/QplrZruJJe7wb4wfsg5 Pqbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=l1A3yvG/qDbFkINjZLEwYv+dyp67MFViPs+0bb0eWWA=; b=e3WN9feDB0QaMGdai5xkDS1rqvNX33Kj6TguOsFD2RFiBARSzxuukAHWuOwdG/4BQi neZFOmTF6mQYQc2iuk29zzjoa1EsywCWr1Ar64V7N49PJ8nRsX3FoTsSBaySZlsPEWtu JAgoALw+CFSu8L/AYGBfqDPGzeaofDtigXINXgNtgOs3c8PEV3Iv/x5KOdqaZww93tEZ DBOZHowFa4pdHRe6h4Xm3k/JHRiXMUwABsi466xGmodWYUnzgwBw5Uo14p31Fl35uHFq gTm0XLgHYh7wS/iMLk3lKQnbeKDmeJSmFxMA91EQmbOExUqUQkRwWJN/y3zCf6cRzKu1 oREg== 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 o13-v6si7065312pll.86.2018.08.30.09.33.22; Thu, 30 Aug 2018 09:33:36 -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 S1727629AbeH3UfI (ORCPT + 99 others); Thu, 30 Aug 2018 16:35:08 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45514 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727200AbeH3UfI (ORCPT ); Thu, 30 Aug 2018 16:35:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2F8A27A9; Thu, 30 Aug 2018 09:32:11 -0700 (PDT) Received: from [10.4.12.81] (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF85B3F557; Thu, 30 Aug 2018 09:32:09 -0700 (PDT) Subject: Re: [PATCH] EDAC, ghes: use CPER module handles to locate DIMMs To: wufan Cc: mchehab@kernel.org, bp@alien8.de, baicar.tyler@gmail.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <1535567632-18089-1-git-send-email-wufan@codeaurora.org> <000f01d4406f$6ce8f160$46bad420$@codeaurora.org> From: James Morse Message-ID: <1ac15a80-6f9a-cf9d-8e79-37d10549a4ca@arm.com> Date: Thu, 30 Aug 2018 17:32:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <000f01d4406f$6ce8f160$46bad420$@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fan, On 30/08/18 15:40, wufan wrote: >>> @@ -327,12 +349,20 @@ void ghes_edac_report_mem_error(int sev, >> struct cper_sec_mem_err *mem_err) >>> p += sprintf(p, "bit_pos:%d ", mem_err->bit_pos); >>> if (mem_err->validation_bits & >> CPER_MEM_VALID_MODULE_HANDLE) { >>> const char *bank = NULL, *device = NULL; >>> + int index = -1; >>> + >>> dmi_memdev_name(mem_err->mem_dev_handle, &bank, >> &device); >> >>> + p += sprintf(p, "DIMM DMI handle: 0x%.4x ", >>> + mem_err->mem_dev_handle); >>> if (bank != NULL && device != NULL) >>> p += sprintf(p, "DIMM location:%s %s ", bank, device); >>> - else >>> - p += sprintf(p, "DIMM DMI handle: 0x%.4x ", >>> - mem_err->mem_dev_handle); >> >> Why do we now print the handle every time? The handle is pretty >> meaningless, it can only be used to find the location-strings, if we get those >> we print them instead. > > For ghes_edac the bank/device is informational, and nothing would go wrong > if the bank/device numbers are the same as another entry. But the handle > is now critical for DIMM lookup, thus pull it out. Is printing the handle to the kernel log critical? I'd expect something collecting errors to read from sysfs, not dmesg. I thought the whole point here was to update the per-dimm counters in sysfs. Thanks, James