linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: tony.luck@intel.com, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org, avadhut.naik@amd.com,
	john.allen@amd.com, muralidhara.mk@amd.com,
	sathyapriya.k@amd.com, naveenkrishna.chatradhi@amd.com
Subject: Re: [PATCH v2 2/3] RAS/AMD/FMPM: Save SPA values
Date: Fri, 1 Mar 2024 16:50:34 +0100	[thread overview]
Message-ID: <20240301155034.GAZeH5StN80cO15qq_@fat_crate.local> (raw)
In-Reply-To: <20240301143748.854090-3-yazen.ghannam@amd.com>

On Fri, Mar 01, 2024 at 08:37:47AM -0600, Yazen Ghannam wrote:
> The system physical address (SPA) of an error is not a stable value. It
> will change depending on the location of the memory: parts can be
> swapped. And it will change depending on memory topology: NUMA nodes
> and/or interleaving can be adjusted.
> 
> Therefore, the SPA value is not part of the "FRU Memory Poison" record
> format. And it will not be saved to persistent storage.
> 
> However, the SPA values can be helpful during debug and for system
> admins during run time.
> 
> Save the SPA values in a separate structure. This is updated when
> records are restored and when new errors are saved.
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> ---
> Link:
> https://lore.kernel.org/r/20240226152941.2615007-3-yazen.ghannam@amd.com
> 
> v1->v2:
> * Changed variable names to remove "sys_" prefix. (Boris)
> * Used "spa_" prefix to highlight that these are for SPA values. (Yazen)
> * Added warning to "index out-of-bound" condition. (Boris)
> * Reworked save_spa() flow to get a valid array position before saving
>   SPA value (Yazen).
> 
>  drivers/ras/amd/fmpm.c | 68 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 68 insertions(+)

Fixups ontop:

---

diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
index a7bb36eb60cb..8c3188488673 100644
--- a/drivers/ras/amd/fmpm.c
+++ b/drivers/ras/amd/fmpm.c
@@ -125,7 +125,7 @@ static u64 *spa_entries;
 		  0x12, 0x0a, 0x44, 0x58)
 
 /**
- * DOC: fru_poison_entries (byte)
+ * DOC: max_nr_entries (byte)
  * Maximum number of descriptor entries possible for each FRU.
  *
  * Values between '1' and '255' are valid.
@@ -285,10 +285,12 @@ static void save_spa(struct fru_rec *rec, unsigned int entry,
 	unsigned long spa;
 
 	if (entry >= max_nr_entries) {
-		pr_warn_once("entry out-of-bounds\n");
+		pr_warn_once("FRU descriptor entry %d out-of-bounds (max: %d)\n",
+			     entry, max_nr_entries);
 		return;
 	}
 
+	/* spa_nr_entries is always multiple of max_nr_entries */
 	for (i = 0; i < spa_nr_entries; i += max_nr_entries) {
 		fru_idx = i / max_nr_entries;
 		if (fru_records[fru_idx] == rec)
@@ -296,7 +298,7 @@ static void save_spa(struct fru_rec *rec, unsigned int entry,
 	}
 
 	if (i >= spa_nr_entries) {
-		pr_warn_once("record not found");
+		pr_warn_once("FRU record %d not found\n", i);
 		return;
 	}
 
-- 
Regards/Gruss,
    Boris.

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

  reply	other threads:[~2024-03-01 15:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 14:37 [PATCH v2 0/3] FMPM Debug Updates Yazen Ghannam
2024-03-01 14:37 ` [PATCH v2 1/3] RAS: Export helper to get ras_debugfs_dir Yazen Ghannam
2024-03-01 14:37 ` [PATCH v2 2/3] RAS/AMD/FMPM: Save SPA values Yazen Ghannam
2024-03-01 15:50   ` Borislav Petkov [this message]
2024-03-01 14:37 ` [PATCH v2 3/3] RAS/AMD/FMPM: Add debugfs interface to print record entries Yazen Ghannam
2024-03-02  9:49 ` [PATCH v2 0/3] FMPM Debug Updates Borislav Petkov
2024-03-04  5:13 ` M K, Muralidhara

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=20240301155034.GAZeH5StN80cO15qq_@fat_crate.local \
    --to=bp@alien8.de \
    --cc=avadhut.naik@amd.com \
    --cc=john.allen@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muralidhara.mk@amd.com \
    --cc=naveenkrishna.chatradhi@amd.com \
    --cc=sathyapriya.k@amd.com \
    --cc=tony.luck@intel.com \
    --cc=yazen.ghannam@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;
as well as URLs for NNTP newsgroup(s).