mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] x86/mce/AMD: Define function to get SMCA bank type
@ 2017-12-07 20:39 Yazen Ghannam
  2017-12-07 20:39 ` [PATCH v2 2/2] x86/mce: Report only DRAM ECC as memory errors on AMD systems Yazen Ghannam
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yazen Ghannam @ 2017-12-07 20:39 UTC (permalink / raw)
  To: linux-edac; +Cc: Yazen Ghannam, Borislav Petkov, Tony Luck, x86, linux-kernel

From: Yazen Ghannam <yazen.ghannam@amd.com>

Scalable MCA systems have various types of banks. The bank's type can
determine how we handle errors from it. For example, if a bank represents
a UMC then we will need to convert its address from a normalized address
to a system physical address before handling the error.

Define a static function to return a bank's SMCA type.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
Link:
https://lkml.kernel.org/r/20171201155034.39206-1-Yazen.Ghannam@amd.com

v1->v2:
* Make function static to mcheck/mce_amd.c.

 arch/x86/kernel/cpu/mcheck/mce_amd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index a38ab1fa53a2..219d5115f4d4 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -110,6 +110,16 @@ const char *smca_get_long_name(enum smca_bank_types t)
 }
 EXPORT_SYMBOL_GPL(smca_get_long_name);
 
+static enum smca_bank_types smca_get_bank_type(struct mce *m)
+{
+	struct smca_bank bank = smca_banks[m->bank];
+
+	if (!bank.hwid)
+		return N_SMCA_BANK_TYPES;
+
+	return bank.hwid->bank_type;
+}
+
 static struct smca_hwid smca_hwid_mcatypes[] = {
 	/* { bank_type, hwid_mcatype, xec_bitmap } */
 
-- 
2.14.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-18 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07 20:39 [PATCH v2 1/2] x86/mce/AMD: Define function to get SMCA bank type Yazen Ghannam
2017-12-07 20:39 ` [PATCH v2 2/2] x86/mce: Report only DRAM ECC as memory errors on AMD systems Yazen Ghannam
2017-12-10 16:18   ` Borislav Petkov
2017-12-18 12:01   ` [tip:ras/core] x86/MCE: " tip-bot for Yazen Ghannam
2017-12-10 14:47 ` [PATCH v2 1/2] x86/mce/AMD: Define function to get SMCA bank type Borislav Petkov
2017-12-18 12:00 ` [tip:ras/core] x86/MCE/AMD: Define a " tip-bot for Yazen Ghannam

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