From 6083c0b34072650542bc3ff461f6f2fc1aaf18c9 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 25 Jul 2016 08:44:57 -0500 Subject: [PATCH] UPSTREAM: drivers/elog: put back 4KiB limit The removal of ELOG_FLASH_BASE and ELOG_FLASH_SIZE resulted in the FMAP region for the eventlog to be honored. However, certain systems seem to have a large eventlog region that wasn't being used in practice. Because of the malloc() in the eventlog init sequence a large allocation was now being requested that can exhaust the heap. Put back the 4KiB capacity until the resource usage is fixed. BUG=chrome-os-partner:55593 Change-Id: Ib54b396b48e5be80f737fc3feb0d58348c0d2844 Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://review.coreboot.org/15835 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Paul Menzel Original-Reviewed-by: Furquan Shaikh Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/363386 Reviewed-by: Furquan Shaikh --- src/drivers/elog/elog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c index 95660784aa..0bb4d164e9 100644 --- a/src/drivers/elog/elog.c +++ b/src/drivers/elog/elog.c @@ -499,7 +499,8 @@ static void elog_find_flash(void) flash_base = total_size = 0; } else { flash_base = region_offset(&r); - total_size = region_sz(&r); + /* Keep 4KiB max size until large malloc()s have been fixed. */ + total_size = MIN(4*KiB, region_sz(&r)); } log_size = total_size - sizeof(struct elog_header);