lkml.org 
[lkml]   [2017]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/2] x86/mce/AMD: Define function to get SMCA bank type
Date
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
\
 
 \ /
  Last update: 2017-12-07 21:41    [W:0.044 / U:0.392 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site