Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Robert Richter <rrichter@marvell.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	James Morse <james.morse@arm.com>,
	Aristeu Rozanski <aris@redhat.com>,
	Matthias Brugger <mbrugger@suse.com>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] EDAC/ghes: Setup DIMM label from DMI and use it in error reports
Date: Tue, 19 May 2020 22:25:35 +0200
Message-ID: <20200519202535.GC444@zn.tnic> (raw)
In-Reply-To: <20200518095852.28010-1-rrichter@marvell.com>

On Mon, May 18, 2020 at 11:58:52AM +0200, Robert Richter wrote:
> +static void dimm_setup_label(struct dimm_info *dimm, u16 handle)
> +{
> +	const char *bank = NULL, *device = NULL;
> +
> +	dmi_memdev_name(handle, &bank, &device);
> +
> +	/* both strings must be non-zero */
> +	if (bank && *bank && device && *device)
> +		snprintf(dimm->label, sizeof(dimm->label),
> +			"%s %s", bank, device);
> +	else
> +		snprintf(dimm->label, sizeof(dimm->label),
> +			"unknown memory (handle: 0x%.4x)", handle);

This changes the sysfs strings on my test box like this. 00-ghes.before
and 01-ghes.after are created by doing:

grep -EriIn . /sys/devices/system/edac/ 2>/dev/null > [filename]

edac_mc_alloc_dimms() already sets the dimm->label to "mc#%dmemory#%d"
but I'm guessing that dmi_memdev_name() doesn't give on my machine what
it gives on yours.

Welcome to the wonderful world of consistently implemented firmware!

--- 00-ghes.before      2020-05-19 17:55:50.821220239 +0200
+++ 01-ghes.after       2020-05-19 22:09:28.808492701 +0200
@@ -17,7 +17,7 @@
 /sys/devices/system/edac/mc/mc0/ce_count:1:0
 /sys/devices/system/edac/mc/mc0/mc_name:1:ghes_edac
 /sys/devices/system/edac/mc/mc0/csrow15/ce_count:1:0
-/sys/devices/system/edac/mc/mc0/csrow15/ch0_dimm_label:1:mc#0memory#15
+/sys/devices/system/edac/mc/mc0/csrow15/ch0_dimm_label:1:unknown memory (handle: 0x0030)
 /sys/devices/system/edac/mc/mc0/csrow15/power/runtime_active_time:1:0
 /sys/devices/system/edac/mc/mc0/csrow15/power/runtime_active_kids:1:0
 /sys/devices/system/edac/mc/mc0/csrow15/power/runtime_usage:1:0
@@ -42,7 +42,7 @@
 /sys/devices/system/edac/mc/mc0/power/runtime_enabled:1:disabled & forbidden
 /sys/devices/system/edac/mc/mc0/power/control:1:on
 /sys/devices/system/edac/mc/mc0/csrow31/ce_count:1:0
-/sys/devices/system/edac/mc/mc0/csrow31/ch0_dimm_label:1:mc#0memory#31
+/sys/devices/system/edac/mc/mc0/csrow31/ch0_dimm_label:1:unknown memory (handle: 0x0040)
 /sys/devices/system/edac/mc/mc0/csrow31/power/runtime_active_time:1:0
 /sys/devices/system/edac/mc/mc0/csrow31/power/runtime_active_kids:1:0
 /sys/devices/system/edac/mc/mc0/csrow31/power/runtime_usage:1:0
@@ -73,10 +73,10 @@
 /sys/devices/system/edac/mc/mc0/dimm15/dimm_dev_type:1:Unknown
 /sys/devices/system/edac/mc/mc0/dimm15/size:1:32768
 /sys/devices/system/edac/mc/mc0/dimm15/dimm_ce_count:1:0
-/sys/devices/system/edac/mc/mc0/dimm15/dimm_label:1:mc#0memory#15
+/sys/devices/system/edac/mc/mc0/dimm15/dimm_label:1:unknown memory (handle: 0x0030)
 /sys/devices/system/edac/mc/mc0/dimm15/dimm_location:1:memory 15 
 /sys/devices/system/edac/mc/mc0/dimm15/dimm_edac_mode:1:SECDED
-/sys/devices/system/edac/mc/mc0/seconds_since_reset:1:354
+/sys/devices/system/edac/mc/mc0/seconds_since_reset:1:979
 /sys/devices/system/edac/mc/mc0/dimm31/dimm_ue_count:1:0
 /sys/devices/system/edac/mc/mc0/dimm31/dimm_mem_type:1:Registered-DDR4
 /sys/devices/system/edac/mc/mc0/dimm31/power/runtime_active_time:1:0
@@ -90,7 +90,7 @@
 /sys/devices/system/edac/mc/mc0/dimm31/dimm_dev_type:1:Unknown
 /sys/devices/system/edac/mc/mc0/dimm31/size:1:32768
 /sys/devices/system/edac/mc/mc0/dimm31/dimm_ce_count:1:0
-/sys/devices/system/edac/mc/mc0/dimm31/dimm_label:1:mc#0memory#31
+/sys/devices/system/edac/mc/mc0/dimm31/dimm_label:1:unknown memory (handle: 0x0040)
 /sys/devices/system/edac/mc/mc0/dimm31/dimm_location:1:memory 31 
 /sys/devices/system/edac/mc/mc0/dimm31/dimm_edac_mode:1:SECDED
 /sys/devices/system/edac/mc/mc0/max_location:1:memory 31

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  9:58 Robert Richter
2020-05-19 20:25 ` Borislav Petkov [this message]
2020-05-19 21:30   ` Borislav Petkov
2020-05-20 14:11   ` Robert Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519202535.GC444@zn.tnic \
    --to=bp@alien8.de \
    --cc=aris@redhat.com \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=mchehab@kernel.org \
    --cc=rrichter@marvell.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git