public inbox for linux-edac@vger.kernel.org
 help / color / mirror / Atom feed
From: Muralidhara M K <muralimk@amd.com>
To: <linux-edac@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <bp@alien8.de>,
	<mchehab@kernel.org>, Muralidhara M K <muralidhara.mk@amd.com>,
	Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Subject: [PATCH 1/4] ACPI/APEI: Add erst_get_size() API
Date: Wed, 29 Nov 2023 07:50:31 +0000	[thread overview]
Message-ID: <20231129075034.2159223-2-muralimk@amd.com> (raw)
In-Reply-To: <20231129075034.2159223-1-muralimk@amd.com>

From: Muralidhara M K <muralidhara.mk@amd.com>

Support API for size of a record in the ERST.

Co-developed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Signed-off-by: Muralidhara M K <muralidhara.mk@amd.com>
---
 drivers/acpi/apei/erst.c | 9 +++++++++
 include/acpi/apei.h      | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index bf65e3461531..aae1c133095a 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -420,6 +420,15 @@ static int erst_get_erange(struct erst_erange *range)
 	return 0;
 }
 
+u64 erst_get_size(void)
+{
+	if (erst_disable)
+		return 0;
+
+	return erst_erange.size;
+}
+EXPORT_SYMBOL_GPL(erst_get_size);
+
 static ssize_t __erst_get_record_count(void)
 {
 	struct apei_exec_context ctx;
diff --git a/include/acpi/apei.h b/include/acpi/apei.h
index dc60f7db5524..3b34f463ea44 100644
--- a/include/acpi/apei.h
+++ b/include/acpi/apei.h
@@ -41,6 +41,7 @@ static inline void acpi_hest_init(void) { }
 
 int erst_write(const struct cper_record_header *record);
 ssize_t erst_get_record_count(void);
+u64 erst_get_size(void);
 int erst_get_record_id_begin(int *pos);
 int erst_get_record_id_next(int *pos, u64 *record_id);
 void erst_get_record_id_end(void);
-- 
2.25.1


  reply	other threads:[~2023-11-29  7:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29  7:50 [PATCH 0/4] Persist FRU memory poisons Muralidhara M K
2023-11-29  7:50 ` Muralidhara M K [this message]
2023-11-29  7:50 ` [PATCH 2/4] RAS/fmp: Add FRU memory poison CPER support for Error persistence Muralidhara M K
2023-11-29  7:50 ` [PATCH 3/4] EDAC/amd64: Add sysfs entry to read FRU poison data Muralidhara M K
2023-11-29  7:50 ` [PATCH 4/4] RAS/fmp: Add Documentation on Persistence of FRU memory poisons Muralidhara M K

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=20231129075034.2159223-2-muralimk@amd.com \
    --to=muralimk@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=muralidhara.mk@amd.com \
    --cc=naveenkrishna.chatradhi@amd.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