mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: <linux-edac@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
	Borislav Petkov <borislav.petkov@amd.com>
Subject: [PATCH 02/12] EDAC, MCE: Add F15h DC MCE decoder
Date: Wed, 10 Nov 2010 20:02:11 +0100	[thread overview]
Message-ID: <1289415741-15000-3-git-send-email-bp@amd64.org> (raw)
In-Reply-To: <1289415741-15000-1-git-send-email-bp@amd64.org>

From: Borislav Petkov <borislav.petkov@amd.com>

Add a decoder for F15h DC MCEs to support the new types of DC MCEs
introduced by the BD microarchitecture.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
 drivers/edac/mce_amd.c |   79 +++++++++++++++++++++++++++++++++++++-----------
 drivers/edac/mce_amd.h |    2 +-
 2 files changed, 62 insertions(+), 19 deletions(-)

diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index 01853ee..12bae3b 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -75,7 +75,7 @@ static const char *f10h_nb_mce_desc[] = {
 	"ECC Error in the Probe Filter directory"
 };
 
-static bool f12h_dc_mce(u16 ec)
+static bool f12h_dc_mce(u16 ec, u8 xec)
 {
 	bool ret = false;
 
@@ -93,7 +93,7 @@ static bool f12h_dc_mce(u16 ec)
 	return ret;
 }
 
-static bool f10h_dc_mce(u16 ec)
+static bool f10h_dc_mce(u16 ec, u8 xec)
 {
 	u8 r4  = (ec >> 4) & 0xf;
 	u8 ll  = ec & 0x3;
@@ -102,20 +102,20 @@ static bool f10h_dc_mce(u16 ec)
 		pr_cont("during data scrub.\n");
 		return true;
 	}
-	return f12h_dc_mce(ec);
+	return f12h_dc_mce(ec, xec);
 }
 
-static bool k8_dc_mce(u16 ec)
+static bool k8_dc_mce(u16 ec, u8 xec)
 {
 	if (BUS_ERROR(ec)) {
 		pr_cont("during system linefill.\n");
 		return true;
 	}
 
-	return f10h_dc_mce(ec);
+	return f10h_dc_mce(ec, xec);
 }
 
-static bool f14h_dc_mce(u16 ec)
+static bool f14h_dc_mce(u16 ec, u8 xec)
 {
 	u8 r4	 = (ec >> 4) & 0xf;
 	u8 ll	 = ec & 0x3;
@@ -170,6 +170,54 @@ static bool f14h_dc_mce(u16 ec)
 	return ret;
 }
 
+static bool f15h_dc_mce(u16 ec, u8 xec)
+{
+	bool ret = true;
+
+	if (MEM_ERROR(ec)) {
+
+		switch (xec) {
+		case 0x0:
+			pr_cont("Data Array access error.\n");
+			break;
+
+		case 0x1:
+			pr_cont("UC error during a linefill from L2/NB.\n");
+			break;
+
+		case 0x2:
+		case 0x11:
+			pr_cont("STQ access error.\n");
+			break;
+
+		case 0x3:
+			pr_cont("SCB access error.\n");
+			break;
+
+		case 0x10:
+			pr_cont("Tag error.\n");
+			break;
+
+		case 0x12:
+			pr_cont("LDQ access error.\n");
+			break;
+
+		default:
+			ret = false;
+		}
+	} else if (BUS_ERROR(ec)) {
+
+		if (!xec)
+			pr_cont("during system linefill.\n");
+		else
+			pr_cont(" Internal %s condition.\n",
+				((xec == 1) ? "livelock" : "deadlock"));
+	} else
+		ret = false;
+
+	return ret;
+}
+
 static void amd_decode_dc_mce(struct mce *m)
 {
 	u16 ec = m->status & 0xffff;
@@ -183,20 +231,14 @@ static void amd_decode_dc_mce(struct mce *m)
 
 		if (tt == TT_DATA) {
 			pr_cont("%s TLB %s.\n", LL_MSG(ec),
-				(xec ? "multimatch" : "parity error"));
+				((xec == 2) ? "locked miss"
+					    : (xec ? "multimatch" : "parity")));
 			return;
 		}
-		else
-			goto wrong_dc_mce;
-	}
-
-	if (!fam_ops->dc_mce(ec))
-		goto wrong_dc_mce;
-
-	return;
-
-wrong_dc_mce:
-	pr_emerg(HW_ERR "Corrupted DC MCE info?\n");
+	} else if (fam_ops->dc_mce(ec, xec))
+		;
+	else
+		pr_emerg(HW_ERR "Corrupted DC MCE info?\n");
 }
 
 static bool k8_ic_mce(u16 ec)
@@ -654,6 +696,7 @@ static int __init mce_amd_init(void)
 
 	case 0x15:
 		xec_mask = 0x1f;
+		fam_ops->dc_mce = f15h_dc_mce;
 		break;
 
 	default:
diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
index 35f6e0e..c12394d 100644
--- a/drivers/edac/mce_amd.h
+++ b/drivers/edac/mce_amd.h
@@ -100,7 +100,7 @@ struct err_regs {
  * per-family decoder ops
  */
 struct amd_decoder_ops {
-	bool (*dc_mce)(u16);
+	bool (*dc_mce)(u16, u8);
 	bool (*ic_mce)(u16);
 	bool (*nb_mce)(u16, u8);
 };
-- 
1.7.3.1.50.g1e633


  parent reply	other threads:[~2010-11-10 19:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 19:02 [PATCH 00/12] EDAC, MCE: F15h MCE decoding Borislav Petkov
2010-11-10 19:02 ` [PATCH 01/12] EDAC, MCE: Select extended error code mask Borislav Petkov
2010-11-10 19:12   ` Luck, Tony
2010-11-10 19:15     ` Luck, Tony
2010-11-10 19:23       ` Borislav Petkov
2010-11-10 19:02 ` Borislav Petkov [this message]
2010-11-10 19:02 ` [PATCH 03/12] EDAC, MCE: Add F15h IC MCE decoder Borislav Petkov
2010-11-10 19:02 ` [PATCH 04/12] EDAC, MCE: Add F15h CU " Borislav Petkov
2010-11-10 19:02 ` [PATCH 05/12] EDAC, MCE: No F15h LS " Borislav Petkov
2010-11-10 19:02 ` [PATCH 06/12] EDAC, MCE: Add an F15h NB " Borislav Petkov
2010-11-10 19:02 ` [PATCH 07/12] EDAC, MCE: Add F15 EX " Borislav Petkov
2010-11-10 19:02 ` [PATCH 08/12] EDAC, MCE: Add F15h FP " Borislav Petkov
2010-11-10 19:02 ` [PATCH 09/12] EDAC, MCE: Overhaul error fields extraction macros Borislav Petkov
2010-11-10 19:02 ` [PATCH 10/12] EDAC, MCE: Shorten error report formatting Borislav Petkov
2010-11-10 19:02 ` [PATCH 11/12] EDAC, MCE: Allow F15h bank 6 MCE injection Borislav Petkov
2010-11-10 19:02 ` [PATCH 12/12] EDAC, MCE: Enable MCE decoding on F15h Borislav Petkov

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=1289415741-15000-3-git-send-email-bp@amd64.org \
    --to=bp@amd64.org \
    --cc=borislav.petkov@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /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

Powered by JetHome