From: Naveen Krishna Chatradhi <nchatrad@amd.com>
To: linux-edac@vger.kernel.org, x86@kernel.org
Cc: linux-kernel@vger.kernel.org, bp@alien8.de, mingo@redhat.com,
mchehab@kernel.org, Mukul Joshi <mukul.joshi@amd.com>
Subject: [PATCH 2/3] x86/MCE/AMD: Helper function to check UMC v2
Date: Tue, 11 May 2021 20:55:37 +0530 [thread overview]
Message-ID: <20210511152538.148084-2-nchatrad@amd.com> (raw)
In-Reply-To: <20210511152538.148084-1-nchatrad@amd.com>
From: Mukul Joshi <mukul.joshi@amd.com>
Add a helper function to check if a given bank is
UMCv2 or not.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: John Clements <John.Clements@amd.com>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
arch/x86/include/asm/mce.h | 2 ++
arch/x86/kernel/cpu/mce/amd.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index cf7f35fdf2c8..8cbe7221a253 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -357,6 +357,7 @@ extern int mce_threshold_remove_device(unsigned int cpu);
void mce_amd_feature_init(struct cpuinfo_x86 *c);
int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr);
+bool is_smca_umc_v2(int bank);
#else
@@ -366,6 +367,7 @@ static inline bool amd_mce_is_memory_error(struct mce *m) { return false; };
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
static inline int
umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr) { return -EINVAL; };
+static inline bool is_smca_umc_v2(int bank) { return false; };
#endif
static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) { return mce_amd_feature_init(c); }
diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 055f3a0acf5e..41718e3111f2 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -1542,3 +1542,9 @@ int mce_threshold_create_device(unsigned int cpu)
mce_threshold_remove_device(cpu);
return err;
}
+
+bool is_smca_umc_v2(int bank)
+{
+ return (smca_get_bank_type(bank) == SMCA_UMC_V2);
+}
+EXPORT_SYMBOL_GPL(is_smca_umc_v2);
--
2.17.1
next prev parent reply other threads:[~2021-05-11 15:26 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 15:25 [PATCH 1/3] x86/MCE/AMD, EDAC/mce_amd: Add new SMCA bank types Naveen Krishna Chatradhi
2021-05-11 15:25 ` Naveen Krishna Chatradhi [this message]
2021-05-11 17:34 ` [PATCH 2/3] x86/MCE/AMD: Helper function to check UMC v2 Borislav Petkov
2021-05-12 1:40 ` Joshi, Mukul
2021-05-12 7:26 ` Borislav Petkov
2021-09-13 2:13 ` [PATCHv2 1/2] x86/MCE/AMD: Export smca_get_bank_type symbol Mukul Joshi
2021-09-13 2:13 ` [PATCHv2 2/2] drm/amdgpu: Register MCE notifier for Aldebaran RAS Mukul Joshi
2021-09-22 11:40 ` Borislav Petkov
2021-09-22 19:43 ` Joshi, Mukul
2021-09-22 19:36 ` [PATCHv3 " Mukul Joshi
2021-09-23 14:29 ` Yazen Ghannam
2021-09-23 14:37 ` Borislav Petkov
2021-09-23 15:31 ` Joshi, Mukul
2021-09-23 15:30 ` Joshi, Mukul
2021-09-23 17:23 ` Yazen Ghannam
2021-09-23 18:14 ` Borislav Petkov
2021-09-24 19:46 ` Yazen Ghannam
2021-09-25 11:20 ` Borislav Petkov
2021-09-27 18:37 ` Yazen Ghannam
2021-09-23 18:34 ` Joshi, Mukul
2021-09-23 22:04 ` [PATCHv4 " Mukul Joshi
2021-09-24 19:53 ` Yazen Ghannam
2021-09-22 11:33 ` [PATCHv2 1/2] x86/MCE/AMD: Export smca_get_bank_type symbol Borislav Petkov
2021-09-22 16:27 ` Deucher, Alexander
2021-09-22 16:43 ` Borislav Petkov
2021-09-22 16:47 ` Joshi, Mukul
2021-05-11 15:25 ` [PATCH 3/3] x86/mce: Add MCE priority for Accelerator devices Naveen Krishna Chatradhi
2021-05-11 17:27 ` [PATCH 1/3] x86/MCE/AMD, EDAC/mce_amd: Add new SMCA bank types Borislav Petkov
2021-05-24 16:41 ` Chatradhi, Naveen Krishna
2021-05-25 18:02 ` Borislav Petkov
2021-05-25 20:03 ` Yazen Ghannam
2021-05-25 20:12 ` Borislav Petkov
2021-05-26 16:46 ` [PATCH v2] " Naveen Krishna Chatradhi
2021-05-28 15:25 ` [tip: ras/core] " tip-bot2 for 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=20210511152538.148084-2-nchatrad@amd.com \
--to=nchatrad@amd.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mingo@redhat.com \
--cc=mukul.joshi@amd.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