summaryrefslogtreecommitdiff
path: root/src/drivers/elog/elog.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2012-09-01 14:00:23 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-11-08 19:39:32 +0100
commit5c88c6f2d797b7fbcbf844a79356fcc833eb5338 (patch)
tree04c12ec91fdc7fe383f242dd9e785b7b6f5477e4 /src/drivers/elog/elog.c
parent3beb6db6dda7795639d2bb8ec1a1aa3106a4c301 (diff)
downloadcoreboot-5c88c6f2d797b7fbcbf844a79356fcc833eb5338.tar.xz
elog: add extended management engine event
We are seeing ME disabled and ME error events on some devices and this extended info can help with debug. Also fix a potential issue where if the log does manage to get completely full it will never try to shrink it because the only call to shrink the log happens after a successful event write. Add a check at elog init time to shrink the log size. Change-Id: Ib81dc231f6a004b341900374e6c07962cc292031 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/1739 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/drivers/elog/elog.c')
-rw-r--r--src/drivers/elog/elog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 7be443a375..748adafcf3 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -803,6 +803,10 @@ int elog_init(void)
elog_add_event_word(ELOG_TYPE_LOG_CLEAR,
elog_get_flash()->total_size);
+ /* Shrink the log if we are getting too full */
+ if (elog_get_mem()->next_event_offset >= CONFIG_ELOG_FULL_THRESHOLD)
+ elog_shrink();
+
#if CONFIG_ELOG_BOOT_COUNT && !defined(__SMM__)
/* Log boot count event except in S3 resume */
if (acpi_slp_type != 3)