]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
Cleanup MCE error log on non-x86 args
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 15 Jul 2024 14:40:26 +0000 (14:40 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 16 Jul 2024 05:46:12 +0000 (07:46 +0200)
We can only register for MCE on x86 arch.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-events.c
ras-mce-handler.c

index 2b4130bc76c086798332f4febfe079c948eb6fad..7fe98c5d9d73a94f41c03a0b35be07515e923aa7 100644 (file)
@@ -988,7 +988,7 @@ int handle_ras_events(int record_events)
 
 #ifdef HAVE_MCE
        rc = register_mce_handler(ras, cpus);
-       if (rc)
+       if (rc && rc != -ENOENT)
                log(ALL, LOG_INFO, "Can't register mce handler\n");
        if (ras->mce_priv) {
                rc = add_event_handler(ras, pevent, page_size,
index 0f0913244e03b0b6058e0ff05b25050342251ffb..f58e291eb9e704d588d3cadaef0eb9f27d2023fe 100644 (file)
@@ -186,6 +186,11 @@ static int detect_cpu(struct mce_priv *mce)
                        seen |= CPU_FLAGS;
                }
        }
+       if (!seen) {
+               log(ALL, LOG_INFO, "Can't find a x86 CPU at /proc/cpuinfo. Disabling MCE handler.\n");
+               ret = -ENOENT;
+               goto ret;
+       }
 
        if (seen != CPU_ALL) {
                log(ALL, LOG_INFO, "Can't parse /proc/cpuinfo: missing%s%s%s%s%s\n",