linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Shuai Xue <xueshuai@linux.alibaba.com>
Cc: mchehab@kernel.org, bp@alien8.de, james.morse@arm.com,
	rric@kernel.org, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org, zhangliguang@linux.alibaba.com,
	zhuo.song@linux.alibaba.com
Subject: Re: [PATCH] edac,ghes,cper: Add device to Memory Error Record
Date: Tue, 30 Nov 2021 11:13:14 -0800	[thread overview]
Message-ID: <YaZ3yiIBRj6qIg2h@agluck-desk2.amr.corp.intel.com> (raw)
In-Reply-To: <20211130131648.85860-1-xueshuai@linux.alibaba.com>

On Tue, Nov 30, 2021 at 09:16:48PM +0800, Shuai Xue wrote:
> If Bit 7 of Validation Bits is valid, the device number of the memory
> associated with errors should be reported to Memory Error Record.
> 
> Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
> ---
>  drivers/edac/ghes_edac.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
> index a918ca93e4f7..cf98b270d6f7 100644
> --- a/drivers/edac/ghes_edac.c
> +++ b/drivers/edac/ghes_edac.c
> @@ -378,6 +378,8 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
>  	if (mem_err->validation_bits & CPER_MEM_VALID_BANK_ADDRESS)
>  		p += sprintf(p, "bank_address:%d ",
>  			     mem_err->bank & CPER_MEM_BANK_ADDRESS_MASK);
> +	if (mem_err->validation_bits & CPER_MEM_VALID_DEVICE)
> +		p += sprintf(p, "device:%d ", mem_err->device);
>  	if (mem_err->validation_bits & (CPER_MEM_VALID_ROW | CPER_MEM_VALID_ROW_EXT)) {
>  		u32 row = mem_err->row;
>  

This looks OK (same as code in drivers/firmware/efi/cper.c in the
cper_mem_err_location() function. But that makes me wonder why there
is near duplication of code in ghes_edac.c?

The cper.c code seems to be written defensively using scnprintf()
instead of sprintf().  Could ghes_edac share the same code?

-Tony

  reply	other threads:[~2021-11-30 19:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 13:16 [PATCH] edac,ghes,cper: Add device to Memory Error Record Shuai Xue
2021-11-30 19:13 ` Luck, Tony [this message]
2021-12-02 13:32   ` Shuai Xue

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=YaZ3yiIBRj6qIg2h@agluck-desk2.amr.corp.intel.com \
    --to=tony.luck@intel.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rric@kernel.org \
    --cc=xueshuai@linux.alibaba.com \
    --cc=zhangliguang@linux.alibaba.com \
    --cc=zhuo.song@linux.alibaba.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).