mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: Mark Brown <broonie@debian.org>
Cc: linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>,
	Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Tony Luck <tony.luck@intel.com>,
	Borislav Petkov <bp@alien8.de>, Hanjun Guo <guohanjun@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Terry Bowman <terry.bowman@amd.com>,
	Dan Williams <djbw@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Morduan Zang <zhangdandan@uniontech.com>,
	linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org,
	acpica-devel@lists.linux.dev
Subject: Re: [PATCH v3 3/7] cper: add helpers to handle Memory Error Section 2
Date: Mon, 9 Nov 2026 11:56:23 +0100	[thread overview]
Message-ID: <da9a9306-2966-442e-9bf0-916b54f74b5c@arm.com> (raw)
In-Reply-To: <6016f3f4-7bf7-4b71-9b8f-06a7f31095b0@sirena.org.uk>


On 11/4/26 18:25, Mark Brown wrote:
> On Wed, Nov 04, 2026 at 12:03:11PM +0100, Pierre Gondois wrote:
>> Add separate location and printing helpers for Memory Error
>> Section 2:
>> - cper_mem_err2_location()
>> - cper_dimm_err2_location()
>> - cper_print_mem2()
>> +int cper_dimm_err2_location(const struct cper_sec_mem_err2 *mem, char *msg)
>> +{
>> +	u32 len, n;
>> +	const char *bank = NULL, *device = NULL;
>> +
>> +	if (!msg || !(mem->validation_bits & CPER_MEM2_VALID_MODULE_HANDLE))
>> +		return 0;
>> +
>> +	/* SMBIOS handles are 16 bits; never truncate a Section 2 handle. */
>> +	if (mem->mem_dev_handle <= U16_MAX)
>> +		dmi_memdev_name(mem->mem_dev_handle, &bank, &device);
>> +	else
>> +		pr_warn(FW_WARN "Memory Error Section 2 module handle 0x%x exceeds SMBIOS range\n",
>> +			mem->mem_dev_handle);
> Should this be rate limited?
>
>> +	len = CPER_REC_LEN;
>> +	if (bank && device)
>> +		n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
>> +	else
>> +		n = snprintf(msg, len,
>> +			     "DIMM location: not present. DMI handle: 0x%.8x ",
>> +			     mem->mem_dev_handle);
> Shouldn't this be scnprintf(), especially in the first case where the
> strings come from the firmware?

Right, I ll update cper_dimm_err_location() aswell.


  reply	other threads:[~2026-11-09 10:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 11:03 [PATCH v3 0/7] CPER: Add Memory Error Section 2 support Pierre Gondois
2026-11-04 11:03 ` [PATCH v3 1/7] cper: use BIT_ULL() for processor and memory validation bits Pierre Gondois
2026-11-04 16:22   ` Mark Brown
2026-11-04 11:03 ` [PATCH v3 2/7] cper: add Memory Error Section 2 structures Pierre Gondois
2026-11-04 11:03 ` [PATCH v3 3/7] cper: add helpers to handle Memory Error Section 2 Pierre Gondois
2026-11-04 17:25   ` Mark Brown
2026-11-09 10:56     ` Pierre Gondois [this message]
2026-11-04 11:03 ` [PATCH v3 4/7] EDAC/ghes: Extract error report initialization Pierre Gondois
2026-11-04 11:03 ` [PATCH v3 5/7] ACPI: APEI: Extract common memory failure handling Pierre Gondois
2026-11-04 11:03 ` [PATCH v3 6/7] ACPI: APEI: add separate Memory Error Section 2 handlers Pierre Gondois
2026-11-04 17:51   ` Mark Brown
2026-11-09 10:55     ` Pierre Gondois
2026-11-04 11:03 ` [PATCH v3 7/7] ACPI: extlog: add Memory Error Section 2 trace event Pierre Gondois
2026-11-04 11:07 ` [PATCH v3 0/7] CPER: Add Memory Error Section 2 support Pierre Gondois
2026-11-09 10:57   ` Pierre Gondois

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=da9a9306-2966-442e-9bf0-916b54f74b5c@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=acpica-devel@lists.linux.dev \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=broonie@debian.org \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=fabio.m.de.francesco@linux.intel.com \
    --cc=guohanjun@huawei.com \
    --cc=james.morse@arm.com \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=leitao@debian.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mchehab@kernel.org \
    --cc=pawel.chmielewski@intel.com \
    --cc=rafael@kernel.org \
    --cc=terry.bowman@amd.com \
    --cc=tony.luck@intel.com \
    --cc=xueshuai@linux.alibaba.com \
    --cc=zhangdandan@uniontech.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

all inboxes | Powered by JetHome®