summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/elog/elog.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index ff4f0364c5..d41457d552 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -737,6 +737,21 @@ static int elog_sync_to_nv(void)
}
/*
+ * Do not log boot count events in S3 resume or SMM.
+ */
+static bool elog_do_add_boot_count(void)
+{
+ if (ENV_SMM)
+ return false;
+
+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
+ return !acpi_is_wakeup_s3();
+#else
+ return true;
+#endif
+}
+
+/*
* Event log main entry point
*/
int elog_init(void)
@@ -784,20 +799,15 @@ int elog_init(void)
" shrink size %d\n", region_device_sz(&nv_dev),
full_threshold, shrink_size);
-#if !defined(__SMM__)
- /* Log boot count event except in S3 resume */
-#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
- if (!acpi_is_wakeup_s3())
-#endif
+ if (elog_do_add_boot_count()) {
elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read());
#if IS_ENABLED(CONFIG_ARCH_X86)
- /* Check and log POST codes from previous boot */
- if (IS_ENABLED(CONFIG_CMOS_POST))
- cmos_post_log();
+ /* Check and log POST codes from previous boot */
+ if (IS_ENABLED(CONFIG_CMOS_POST))
+ cmos_post_log();
#endif
-#endif
-
+ }
return 0;
}