[PATCH] EDAC/mce_amd: Reduce unnecessary spew in dmesg if SMCA feature bit is not exposed

From: Smita Koralahalli
Date: Mon Jun 14 2021 - 17:21:51 EST


The SMCA feature bit is not exposed on the guest.

This causes a lot of noise in dmesg as the warning is printed for each
logical CPU.

$ dmesg |grep -i family

[ 0.031000] smpboot: CPU0: AMD EPYC-Milan Processor (family: 0x19, model: 0x1, stepping: 0x1)
[ 4.653422] Huh? What family is it: 0x19?!
[ 4.720732] Huh? What family is it: 0x19?!
[ 6.171028] Huh? What family is it: 0x19?!
[ 6.766552] Huh? What family is it: 0x19?!
[ 6.811119] Huh? What family is it: 0x19?!
[ 6.839855] Huh? What family is it: 0x19?!

Give these messages debug severity and output once as it is mostly useful
for module developers and just noise for users.

Rephrase the statement to make it more meaningful.

Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@xxxxxxx>
---
drivers/edac/mce_amd.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index 5dd905a3f30c..2a9899088389 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -1227,13 +1227,9 @@ static int __init mce_amd_init(void)
fam_ops.mc2_mce = f16h_mc2_mce;
break;

- case 0x17:
- case 0x18:
- pr_warn_once("Decoding supported only on Scalable MCA processors.\n");
- return -EINVAL;
-
default:
- printk(KERN_WARNING "Huh? What family is it: 0x%x?!\n", c->x86);
+ pr_debug_once("MCE decoding is not supported for family: 0x%x\n",
+ c->x86);
return -EINVAL;
}

--
2.17.1