mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muralidhara M K <muralimk@amd.com>
To: <linux-edac@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <mchehab@kernel.org>,
	<bp@alien8.de>, Muralidhara M K <muralidhara.mk@amd.com>,
	Gupta Akshay <akshay.gupta@amd.com>
Subject: [PATCH 1/3] rasdaemon: Decode bank_type based on InstanceIdHi in MCA_IPID.
Date: Tue, 4 Jul 2023 10:58:21 +0000	[thread overview]
Message-ID: <20230704105823.3516889-2-muralimk@amd.com> (raw)
In-Reply-To: <20230704105823.3516889-1-muralimk@amd.com>

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

On some AMD systems, InstanceIdHi bits b'47:44 of MCA_IPID register
are Reserved, but the same bits are defined on viz. Genoa. So bank type
is erroneously decoded.

Incorrect bank_type which is socket_id value is observed from the
register InstanceIdHi field.
Handle these bit fields appropriately to get correct bank_type.

Signed-off-by: Muralidhara M K <muralidhara.mk@amd.com>
Tested-by: Gupta Akshay <akshay.gupta@amd.com>
---
 mce-amd-smca.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mce-amd-smca.c b/mce-amd-smca.c
index f69b555..4a2e645 100644
--- a/mce-amd-smca.c
+++ b/mce-amd-smca.c
@@ -790,6 +790,10 @@ static void decode_smca_error(struct mce_event *e, struct mce_priv* m)
 	const struct smca_hwid *s_hwid;
 	uint32_t mcatype_hwid = EXTRACT(e->ipid, 32, 63);
 	uint8_t mcatype_instancehi = EXTRACT(e->ipid, 44, 47);
+	/* MCA_IPID[43:32] HardwareID of IP associated with MCA bank */
+	uint16_t ipid_hwid = EXTRACT(e->ipid, 32, 43);
+	/* MCA_IPID[63:48] McaType of the MCA bank within the IP */
+	uint16_t ipid_mcatype = EXTRACT(e->ipid, 48, 63);
 	unsigned int csrow = -1, channel = -1;
 	unsigned int i;
 
@@ -800,6 +804,11 @@ static void decode_smca_error(struct mce_event *e, struct mce_priv* m)
 		if (mcatype_hwid == s_hwid->mcatype_hwid) {
 			bank_type = s_hwid->bank_type;
 			break;
+		} else if ((mcatype_instancehi == e->socketid) &&
+			(ipid_hwid == EXTRACT(s_hwid->mcatype_hwid, 0, 11)) &&
+			(ipid_mcatype == EXTRACT(s_hwid->mcatype_hwid, 16, 31))) {
+			bank_type = s_hwid->bank_type;
+			break;
 		}
 		if (mcatype_instancehi >= NONCPU_NODE_INDEX)
 			bank_type = SMCA_UMC_V2;
-- 
2.25.1


  reply	other threads:[~2023-07-04 10:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 10:58 [PATCH 0/3] Update rasdaemon decoding for AMD systems Muralidhara M K
2023-07-04 10:58 ` Muralidhara M K [this message]
2023-07-04 10:58 ` [PATCH 2/3] rasdaemon: Add new MA_LLC, USR_DP, and USR_CP bank types Muralidhara M K
2023-07-04 10:58 ` [PATCH 3/3] rasdaemon: Handle reassigned bit definitions for UMC bank 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=20230704105823.3516889-2-muralimk@amd.com \
    --to=muralimk@amd.com \
    --cc=akshay.gupta@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 \
    /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®