From: Yazen Ghannam <Yazen.Ghannam@amd.com>
To: linux-edac@vger.kernel.org
Cc: Yazen Ghannam <yazen.ghannam@amd.com>,
Borislav Petkov <bp@suse.de>, Tony Luck <tony.luck@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/2] x86/mce/AMD: Define function to get SMCA bank type
Date: Thu, 7 Dec 2017 14:39:54 -0600 [thread overview]
Message-ID: <20171207203955.118171-1-Yazen.Ghannam@amd.com> (raw)
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
next reply other threads:[~2017-12-07 20:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 20:39 Yazen Ghannam [this message]
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
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=20171207203955.118171-1-Yazen.Ghannam@amd.com \
--to=yazen.ghannam@amd.com \
--cc=bp@suse.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).